R ECURSIVE T IME S ERIES D ATA A UGMENTATION
Anonymous authors
Paper under double-blind review
A BSTRACT
Time series observations can be seen as realizations of an underlying dynamical system governed by rules that we typically do not know.
For time series learning tasks we create our model using available data.
Training on available realizations, where data is limited, often induces severe over-fitting thereby preventing generalization.
To address this issue, we introduce a general recursive framework for time series augmentation, which we call the Recursive Interpolation Method (RIM).
New augmented time series are generated using a recursive interpolation function from the original time series for use in training.
We perform theoretical analysis to characterize the proposed RIM and to guarantee its performance under certain conditions.
We apply RIM to diverse synthetic and real-world time series cases to achieve strong performance over non-augmented data on a variety of learning tasks.
Our method is also computationally more efficient and leads to better performance when compared to state of the art time series data augmentation.
I NTRODUCTION
The recent success of machine learning (ML) algorithms depends on the availability of a large amount of data and prodigious computing power, which in practice are not always available.
In real world applications, it is often impossible to indefinitely sample and ideally, we would like the ML model to make good decisions with a limited number of samples.
To overcome these issues, we can exploit additional information such as the structure or invariance in the data that help the ML algorithms efficiently learn and focus on the most important features for solving the task.
In ML, the exploitation of structure in the data has been handled using four different yet complementary approaches: 1) Architecture design, 2) Transfer learning, 3) Data representation, and 4) Data augmentation.
Our focus in this work is on data augmentation approaches in the context of time series learning.
Time series representations do not expose the full information of the underlying dynamical system
Prado (1998) in a way that ML can easily recognize.
For instance, in financial time series data, there are patterns at various scales that can be learned to improve performance.
At a more fundamental level, time series are one-dimensional projections of a hypersurface of data called the phase space of a dynamical system.
This projection results in a loss of information regarding the dynamics of the system.
However, we can still make inferences about the dynamical system that projects a time series realization.
Our approach is to use these inferences to generate additional time series data from the original realization to build richer representations and improve time series pattern identification resulting in more optimal parameters and reduced variance.
We show that our methodology is applicable to a variety of ML algorithms.
Time series learning problems depend on the observed historical data used for training.
We often use a set of time series data to train the ML model.
Each element in the set can be viewed as a sample derived from the underlying stochastic dynamical system.
However, each historical time series data sample is only one particular realization of the underlying stochastic dynamical system in the real world that we are trying to learn.
Our work focuses on problems where available realizations are limited but is not limited to these problems.
In fact, our method can be applied to any time series learning task such as stock price prediction where we often have a single realization or problems with numerous realizations such as speech recognition where many audio clips are available for training.
Let us consider the stock price prediction problem.
The task is to predict or classify the trend of future price.
Ideally we want our model to perform well by capturing the stochastic dynamics of stock markets.
However, we only train the model using a single time series realization or limited historical realizations.
As a result, we do not truly capture the characteristic behaviour of the underlying dynamical system.
Using the original training data and hence one or a few realizations of the underlying dynamical system usually induces over-fitting.
This is not ideal as we want our model to perform well in the stochastic system instead of just a specific realization of that system.
Contributions.
The contributions of our work are as follows:
• We present a time series augmentation technique based on recursive interpolation.
• We provide a theoretical analysis of learning improvement for the proposed time series augmentation method: – We show that our recursive augmentation allows us to control by how much the augmented time series trajectory deviates from the original time series trajectory (Theorem 3.1) and that there is a natural trade-off that is induced when our augmentation deviates considerably from the original time series (Theorem 3.2).
– We demonstrate that our learning bound depends on the dimension and properties of the time series, as well as the neural network structure (Theorems 3.3 and 3.4).
– We believe that this work is the first to offer a theoretical ML framework for time series data augmentation with guarantees for variance reduction in the learned model (Theorem 3.5).
• We empirically demonstrate learning improvements using synthetic data as well as real world time series datasets.
Outline of the paper.
Section 2 presents the literature review.
Section 3 defines the notations, the problem setting, and provides the main theoretical results.
Section 4 describes the experimental results, and Section 5 concludes with a summary and a discussion of future work.
R ELATED W ORK
Augmentation for Computer Vision.
In the computer vision context, there are multiple ways to augment image data like cropping, rotation, translation, flipping, noise injection and so on.
Among them, the mixup technique proposed in Zhang et al.
(2018) is similar to our approach.
They train a neural network on convex combinations of pairs of images and their labels.
However, just applying a static technique to dynamic time series data is not appropriate.
Chen et al.
(2020) showed that data augmentation has a similar effect to an averaging operation over the orbits of a certain group of transformation that keep the data distribution invariant.
Augmentation for Time Series.
There is an exhaustive list of transformations applied to time series that are usually used as data augmentation Wen et al.
(2020a).
Fawaz et al.
(2018) described transformations in the time domain such as time warping and time permutation.
There are methods that belong to the magnitude domain such as magnitude warping, Gaussian noise injection, quantization, scaling, and rotation Wen & Keyes (2019).
There exists other transformations on time series in the frequency and time-frequency domains that are based on Discrete Fourier Transform (DFT).
In this context, they apply transformations in the amplitude and phase spectra of the time series and apply the reverse DFT to generate a new time series signal Gao et al.
Besides the transformations in different domains, there are also more advanced methods, including decomposition-based methods such as the Seasonal and Trend decomposition using Loess (STL) method and its variants Cleveland et al.
Wen et al. (2020b), statistical generative models Kang et al.
(2020), and learning-based methods.
The learning-based methods can be further divided into embedding space DeVries & Taylor (2017), and deep generative models (DGMs) Esteban et al.
(2017); Yoon et al.
These approaches are problem dependent and do not offer theoretical guaranteed learning improvement.
In addition, the learning-based methods require large amounts of training data.
Augmentation for Reinforcement Learning (RL).
Laskin et al.
(2020) presented the RL with
Augmented Data (RAD) module which can augment most RL algorithms that use image data.
They have demonstrated that augmentations such as random translate, random convolutions, crop, patch cutout, amplitude scale, and color jitter can enable RL algorithms to outperform complex advanced methods on standard benchmarks.
Kostrikov et al.
(2021) presented a data augmentation method that can be applied to conventional model-free reinforcement learning (RL) algorithms, enabling learning directly from pixels without the need for pre-training or auxiliary losses.
The inclusion of this augmentation method improves performance substantially, enabling a Soft Actor-Critic agent to reach advanced functioning capability on the DeepMind control suite, outperforming model-based methods and contrastive learning.
Laskin et al.
(2020) and Kostrikov et al.
(2021) show the benefit of RL augmentation using convolutional neural networks (CNNs) for static data but do not handle dynamic data such as time series.
Ideally, we would like to have access to more data that is representative of the underlying dynamics of the system or the regime under which we operate.
However, we can not randomly add more data as there is a probability that the added data might not be representative of our stochastic dynamical system.
To ensure that we are able to add meaningful data without disturbing the properties of the original data, we introduce a new approach called Recursive Interpolation Method.
Our paper proposes a recursive interpolation method for time series as a tool for generating data augmentations.
T HEORETICAL F RAMEWORK FOR R ECURSIVE I NTERPOLATION M ETHOD 3. R ECURSIVE I NTERPOLATION M ETHOD (RIM)
In our setting, we consider each time series sample as one realization from the underlying dynamical system.
The realization consists of features along the time axis.
Let d + 1 be the dimension of the time series sample and { 0 , 1 , . . .
, k } be the label set for each sample.
Then, each sample belongs to R d + × { 0 , 1 , . . .
, k } .
Let S
= { s 0 , s 1 , . . .
, s N } be the collection of the time series samples.
Let
D be a distribution with support [0 , 1) and λ i be drawn from D independently denoted by λ
i ∼ D for time i ∈ [1 : d ] .
Let us denote ⃗λ =
( λ 1 , . . .
, λ d ) to be the vector of interpolations.
For the sake of notational simplicity, in the rest of the paper, we denote ⃗λ ≜ λ and λ ∼ D means that each component λ i of λ is sampled independently from D .
For a given vector λ ∈ [0 , 1) d and a time series sample s ∈ S , we generate an augmented time series sample s λ as follows.
Let us consider an original time series sample s = ( x 0 , x 1 , . . .
, x d , y ) where the time series features ( x 0 , x 1 , . . .
, x d ) ∈ R d +1 and y ∈ { 0 , 1 , . . .
, k } being the label of the corresponding time series sample.
For each λ = ( λ 1 , . . .
, λ d ) ∈ [0 , 1) d ( λ 0 is considered to be a dummy value), we define an augmented sample s λ
= ( x 0 ,λ 0 , x 1 ,λ 1 , . . .
, x d,λ d , y ) such that
[Equation]
and x 0 ,λ 0 = x(1)
[Figure]
[Equation]
[Figure]
[Figure]
[Figure]
[Figure] [Figure] [Figure] The newly generated augmented sample s λ has the same label y as the original sample s .
Our recursive methodology allows us to generate a new time series realization that preserves the trajectory of the original data within some bound (Theorem 3.1).
Notations.
Let l ( s, θ ) be a loss function defined on a sample s and a model parameter θ and similarly l ( s λ , θ ) is the loss defined on the augmented sample using a model parameter θ .
We denote that the distribution P is parametrized by θ ∗ on the sample space S .
Given few realizations { s i } i ∈ [0: N ] from the distribution P , we set:
[Equation]
Using the notations above, our recursive time series data augmentation minimizes the augmented loss under which we take the expectation over the augmented sample space.
We call it average augmented loss and denote it by l aug ( s, θ ) =
E λ ∼D
[ l ( s λ , θ )] .
The three most important aspects of our theoretical framework are the characterization of our recursive time series augmentation: the trade-off that is induced in the learning parameter space (Section 3.2), the learning bound showing the impact of the structural properties of time series and the neural network on the learning parameters (Section 3.3), and better parameter learning with reduced variance when using augmented samples compared to the non augmented ones (Section 3.4).
3. L EARNING B OUND C ONNECTING O RIGINAL T IME S ERIES AND A UGMENTED T IME S ERIES
We define the recursively interpolated time series and show that the augmented time series samples can deviate from the original ones.
We measured this deviation from the original time series using a norm distance between the augmented time series and the original one.
We show that this distance is bounded, where the bound depends on the characteristics of the time series features (Theorem 3.1).
Let sign( t ) =

 if t = if t >−if t <, δ ab = (cid:40)if a = b if a ̸ = b , and D be a distribution with support [0 , 1) .
Theorem 3.1.
(Characterization of recursive augmentation)
If λ n ∼ D and g ( λ n ) =
(1 − λ n )(1 − δ 0 n ) + (1 − sign( n )) , then the following holds.
Let n ∈ [0 : N ] .
(1) x
[Equation]
,λ n = (cid:80) n k =0 ( (cid:81) ni =
k
+1 λ
i ) g ( λ n ) x n where λ j ∼ D for j ≥ 1 and λ 0 is a dummy value.
(2) Let ∥·∥ be a norm, e = E
[ D ] , m ′ =
max i ∈
[1: N ] {∥ x i − x i − 1 ∥} and m = max i ∈
[0: N ] {∥ x i ∥} .
Then
[Equation]
Recall that s =
( x 0 , x 1 , . . .
, x d , y ) and s λ
= ( x 0 ,λ 0 , x 1 ,λ 1 , . . .
, x d,λ d , y ) , we have
[Equation]
Note that we used the l 2 norm for simplicity but in general, any norm satisfies the inequality.
Hence, measuring the distance of each feature between the augmented time series sample and the original one gives us some information about how far they deviate from each other.
Theorem 3.2.
(Learning bound using characterization of recursive augmentation)
Without any loss of generality, let l ( · , · ) ∈ [0 , 1] 1 be a loss function with Lipschitz condition and S
= { s 0 , s 1 , . .
, s N } be the collection of the time series samples.
Then with probability at least 1 − δ over the samples { s i } i ∈ [0: N ] , we have
[Equation]
Moreover, we have
[Equation]
with E λ ∼D [ ∥ s i,λ − s ∥ ] ≤ 2 mde , where e = E [ D ] , d + 1 is the dimension of the time series sample, and m = max i ∈
[0: N ] {∥ x i ∥} .
Theorem 3.2 represents the standard argument for regret bounds using Rademacher complexity.
The term in the left in (Eq.5) is what we call the generalization error or sometimes simply the risk, and the term in the right is called the regret excess risk.
Theorem 3.2 tells us how good is our parameter estimation compared to the optimal parameters.
Our bound is governed by three terms: 1)
Rademacher complexity using the augmented data, 2) the sample size, 3) and the distance between our original time series sample and the augmented one.
Now if the distance in (Eq.5) between time series samples before and after augmentation goes to zero then the learning bound is more tight.
Another implication of the distance being small is that our recursive augmentation method decreases the Rademacher complexity as demonstrated by (Eq.6).
Decreasing Rademacher complexity simply ends up producing a tighter bound on the parameter space.
On the other hand, if the distance in (Eq.5 and Eq.6) becomes large ( i.e. the augmented time series samples deviate considerably from the original ones), then we can not guarantee with high probability that our method will always outperform the non augmented case.
This is a trade-off frequently observed in learning theory.
3. L EARNING B OUND C ONNECTING THE S TRUCTURAL P ROPERTIES OF T IME S ERIES AND N EURAL N ETWORKS
Theorem 3.3.
Let f θ be a neural network with a model parameter θ , ReLU activations, and sigmoid function as the activation function for the last layer denoted by f θ ( x ) =
σ ( g θ ( x )) where g θ ( x ) = ∇ g Tθ x
+ b is the pre-activation signal for the last layer.
Then the cross entropy loss function l ( · , · ) has error bound as follows
[Equation]
where
[Equation]

[Equation]

[Equation] [Equation]
,λ 2 ∂λ i ∂λ 2 | λ
= ⃗ 0 ··· ∂ 2 x d,λd ∂λ i ∂λ 2 | λ = ⃗ 0 .
··· ∂ 2 x d,λd ∂λ i ∂λ d | λ = ⃗ 0 ,   ⃗ 0 ∈ R d denoted by column vector, and ∥·∥ F is a Frobenius norm.
Theorem 3.3 shows how the structural properties of the time series (A and B) and the neural network architecture ( ∇ g θ ) can affect the learning process.
The interpolation vector λ will determine velocity
A and accelerations { B i } i ∈ [1: d ] of the features for the augmented sample s λ .
Theorem 3.4.
(Learning bound with structural properties on time series and neural network)
Let l be the cross entropy loss function such that l ( · , · ) ∈ [0 , 1] .
Then with probability at least 1 − δ over the samples { s i } i ∈ [0: N ] , we have
[Equation]
Moreover, we have
[Equation]
Theorem 3.4 reveals that there is a trade off between the dimension of features of a time series sample, the λ , and the neural network architecture.
A and {B i } i ∈ [1: d ] are the bounds for the velocity and accelerations, respectively, which are computed using the interpolation vector.
The last term of (Eq.8) is constructed by the gradient of the pre-activation g θ with respect to an input, the dimension of features of a time series sample, and the bound for the velocity and accelerations induced by the interpolation vector.
Theorem 3.4 tells us how good is our parameter estimation compared to the optimal parameters.
Our bound is governed by three terms: 1) Rademacher complexity using the augmented data, 2) the sample size, 3) and a term that depends on the dimension of the features of the time series sample d , the structural properties of the time series ( A and B i ), and the neural network architecture ( ∇ g θ ).
Because our RIM method uses a recursive interpolation between two consecutive features, the order of magnitude of A and B do not change drastically, and hence do not blow up the bound.
Another implication of the A and B being small is that our recursive augmentation method decreases the Rademacher complexity as demonstrated by (Eq.9).
Decreasing Rademacher complexity simply ends up producing a tighter bound on the parameter space.
3. V ARIANCE R EDUCTION
Suppose that we observe a set { s 0 , s 1 , . . .
, s N } of N +1 samples from the underlying sample space
S .
Using our RIM method, we can augment the observed sample s i with a distribution D , which results in the set of augmented samples { s i,λ | λ ∼ D} for s i .
Based on mild assumptions (please refer to Appendix A.5) on the regularity of the loss function and on the underlying sample space, we have the following results.
Theorem 3.5.
(Asymptotic normality)
Assume Θ is open.
Then ˆ θ and ˆ θ aug admit the following Bahadur representation;
[Equation]
Therefore, both ˆ θ and ˆ θ aug are asymptotically normal
[Equation]
where the covariance is given by
[Equation]
12) where X = ∇ l ( s, θ ∗ ) − ∇ l aug ( s, θ ∗ ) .
As a consequence, the asymptotic relative efficiency of ˆ θ aug compared to ˆ θ is RE = tr (Σ 0 ) tr (Σ aug ) ≥ 1 .
(Eq.11) describes the asymptotic behaviour of the learning parameters.
(Eq.12) shows that our recursive time series augmentation reduces the variance of the learning parameters.
E XPERIMENTS 4. D ESIGN
We show our results on time series classification tasks with different time series augmentation methods.
We compare the improvements of downstream task performance due to different data augmentation methods by enlarging the training set when we train the classifiers.
To benchmark our RIM approach, we compare our results with that achieved by TimeGAN approach Yoon et al.
We specifically select TimeGAN as they are known to preserve the temporal dynamics thereby maintaining the correlation between variables across time.
Furthermore, with the flexibility of the unsupervised GAN framework and the control offered by the supervised training in autoregressive models, comparing our results against those by TimeGANs can provide us a rigorous benchmark against a tested state-of-the-art approach.
We use a relatively small training set with a large testing set so that it is more challenging for classifiers to generalize and data augmentations are favorable.
Note that we use data augmentation methods on two classes separately as data augmentations should only preserve properties of that particular class.
We use different data augmentation methods on these two classes of time series in our training set as follows: RIM methods can be directly applied to time series within each class to generate new time series for that class to enlarge the original training set such that the generated series are close to original series in that class according to Theorem 3.1.
For the TimeGAN baseline, we train two TimeGANs separately using time series from each class.
Once these two TimeGANs are trained, they are used to generate time series for each class to enlarge the original training set.
We consider four tasks: the first two use synthetic datasets generated by solving 1-dimensional ODEs, and the last two use real-world datasets.
We compare testing accuracy using the original data, augmented data with RIM, and augmented data with TimeGANs.
4. R ESULTS
For task 1, we consider solutions to ODEs containing exponential functions, and two classes in our binary classification correspond to the two ODEs with different parameters.
For task 2, we consider solutions to ODEs with trigonometric functions.
In this setting, ODEs can be thought of as generators that generate time series on which we are performing classification, and ODEs with different parameters invoke different dynamical behaviors on their solutions (time series).
For each class, we generate multiple solutions using corresponding ODE with different initial values.
To make the learning tasks harder, we add random noise to the solution generated by these ODEs.
[Figure]
Task 1: Synthetic data - Exponential ODEs solutions
Two ODEs (time series generators) containing exponential functions we use:
[Equation]
Two ODEs (time series generators) we use: class 1 dydt = 0 .
6 + 0 .
5 sin( y ) ; class 2 dydt = 1 + cos( y )
[Figure]
Task 3: Real dataset - Indoor User Movement from the Radio Signal Strength (RSS) Data
This binary classification task from Bacciu et al.
(2014) is associated with predicting the pattern of user movements in real world office environments from time series generated by a Wireless Sensor
Network (WSN).
The input data contains RSS measured between the nodes of a WSN, comprising of 5 sensors: 4 in the environment and 1 for the user.
Data has been collected during movement of the users and labelled to indicate whether the user’s trajectory will lead to a change in the room or not.
In experiments, we use a subset of the data to form a small training set to challenge our algorithm.
We achieve better and more robust test accuracy than the TimeGAN and the non augmented case when using augmented data as reflected in Figure 4. Since λ is the only parameter used in our RIM augmentation technique, our ablation study paid very precise attention to the choice of the λ parameter. Under this, we tested different λ distributions. Given that we were interested in convex combinations between x i and x i − 1 ,λ i − 1 , we had to restrict λ between 0 and 1.
Two ways to perform this would be: (1) uniformly distribute the weights while sampling λ ; (2) concentrating on a specific part of λ distribution.
To address (1), we use U (0 , 1) which is the main test-bed for all the experiments in the current main text.
Whereas to address the (2), we perform studies using beta distribution by varying its shape parameters to focus on specific parts of densities. We tested Beta (2 , 2) , Beta (0 . 5 , 0 . 5) and Beta (2 , 5) , for which the resulting plots can be found in Appendix C. For all these cases, we observed improvements from using RIM compared to non-augmented training, both in terms of a higher final testing accuracy and with fewer training iterations thereby solidifying the effectiveness of RIM.
[Figure]
Task 4: Real dataset - Ford Engine Condition
We use a subset of the FordA dataset from 2008 WCCI Ford classification challenge Abou-Nasr & Feldkamp (2007).
This dataset contains time series corresponding to measurements of engine noise captured by a motor sensor.
The goal is to detect the presence of a specific issue with the engine by classifying each time series into issue/no issue classes.
We sample 100 time series from FordA to form a small training set to challenge our algorithm and 100 time series for testing.
As shown in
Figure 5, RIM outperforms the TimeGAN and the non augmented case on the test accuracy.
[Figure]
From Figure 2 to Figure 5, we can see that RIM achieves superior performance over the non augmented case.
Furthermore, RIM is also able to achieve better or comparable performance than
TimeGAN on these tasks without going through the extensive training process associated with
GANs.
For our experiments, we train the TimeGAN for 2500 epochs (3 hours on Xeon Processors CPU) for synthetic datasets and 5000 epochs (6 hours on Xeon Processors CPU) for real datasets.
Visual comparisons of the time series generated by RIM and TimeGAN with the original time series are shown in Appendix B.
As expected from Theorem 3.5, RIM has smaller variance and better convergence compared to the non augmented case across all experiments.
4. E XTENSION TO OTHER LEARNING TASKS
Section 4.2 demonstrates results for time series classification.
In this section, we show that RIM can also be used in other learning tasks including continuous time series forecasting and RL.
In continuous time series forecasting, we generally have one historical realization and we leverage that to form our training set composed of (x,y) pairs where x is the previous n time steps’ data and y is the future step target by decomposing the time series into smaller components.
RIM can then be used to generate more time series from the unique realization so that we can enlarge our training set by adding more (x,y) pairs from the original realizations.
We also used RIM to augment state trajectories in RL tasks (please refer to pseudo code in Appendix E.2).
Preliminary experiments for continuous time series forecasting can be found in the Appendix D and RL tasks can be found in the Appendix E.
C ONCLUSION
We developed a Recursive Interpolation Method (RIM) for time series as a data augmentation technique to learn models accurately with limited data.
The RIM is simple, yet effective, supported by theoretical analysis guaranteeing faster convergence.
Theoretically, we proved that the RIM guarantees better parameter convergence with reduced variance.
Empirically, our methodology outperforms the current state-of-the-art approaches for different real world problem domains and synthetic datasets by obtaining higher accuracy with reduced variance.
Because our approach operates on the input time series data, it is invariant to the choice of the ML algorithm.
The methodology described in this paper can be used to enhance ML solutions to a wide variety of time series learning problems.
Appendix
The code for all the experiments can be found at the following link.
A P ROOFS A. P ROOF OF T HEOREM 3.
Let sign( t ) =

 if t = if t >−if t <, δ ab = (cid:40)if a = b if a ̸ = b , and D is a distribution with support [0 , 1) .
Proof of Theorem 3.1 (1) Note that λ 0 is a dummy value for mathematical convenience and (cid:81)
ni =
k +1 λ
i = 1 if n < k + 1 .
We prove this by induction on n .
The case n = 1 shows that x 1 ,λ
= g ( λ 1 ) x 1 + λ 1 g ( λ 0 ) x 0 = (1 − λ 1 ) x 1 + λ 1 x 0 since g ( λ 0 )
= 1 and g ( λ 1 ) = 1 − λ 1 .
We now assume that the inequality holds for n − 1 and prove it for n .
By construction of x n,λ n ,
[Equation]
Thus (1) holds by mathematical induction.
Consider
the equation ∥ x n,λ
n − x n ∥ .
Then by (1) , the first bound can be found by
[Equation]
E [( x n,λ n − x n )]
[Equation]
where e = E [ D ] and m = max i ∈ [0: n ] {∥ x i ∥} .
Now we prove the second bound.
Since
[Equation]
By recursively applying (Eq. 13), we obtain
[Equation]
By Jensen’s inequality and (Eq. 14)
[Equation]
we obtain the second bound
[Equation]
where e = E [ D ] and m ′ =
max i ∈
[1: n ] {∥ x i − x i − 1 ∥} .
Now we show that
[Equation]
where m = max i ∈
[0: N ] {∥ x i ∥} .
The first inequality holds by Minkowski inequality.
A. P ROOF OF T HEOREM 3.
Neural Networks with ReLU Activations.
Using ReLU activation functions, neural networks are constructed by piecewise linear functions of an input.
Such a neural network g θ can be formulated by ∇
g
Tθ x + b where x is an input, ∇ g Tθ is the gradient of g θ ( x ) along x .
Lemma A.1.
(Structure of partial derivative) Let s =
( x 0 , . . .
, x d ) be one sample drawn from time series and λ ∈ [0 , 1] d .
Then
[Equation]
Proof.
If i < j , then x i,λ i does not depend on λ j .
Hence ∂x i,λi ∂λ j = 0 .
If i = j , then x i,
[Equation]
Hence ∂x i,λi ∂λ j = ( x i − 1 ,λ i − 1 − x i ) .
If i > j , we prove this by induction on i .
The case i =
j + 1 shows that x
[Equation]
+1 ) .
Since x j +1 is not depedent on λ j and ∂x j,λj ∂λ j = ( x j − 1 ,λ j − 1 − x j ) , we have ∂x j +1 ,λj +1 ∂λ
j = λ j +
( x j − 1 ,λ j − 1 − x j ) .
We now assume that the inequality holds for i and prove it for i + 1 .
Since x i +1 ,λ i +
=
(1 − λ i +1 )
x i +
+ λ
i +1 x
i,λ i =
x i +
+ λ i +
( x i,λ i − x i +1 ) and ∂x i,λ i ∂λ
j = ( i (cid:89) k
= j + λ k )( x j − 1 ,λ j − 1 − x j ) ,
[Equation]
As a consequence of mathematical induction, the conclusion holds.
We use neural networks with ReLU activations and sigmoid function as the activation function for the last layer.
So, a neural network f θ ( x ) =
σ ( g θ ( x )) where g θ ( x ) = ∇ g Tθ x
+ b is the pre-activation signal for the last layer.
Recall that we denote by ⃗λ ≜ λ and λ ∼ D means that each component λ i of λ is sampled independently from D .
Proof of Theorem 3.2 .
Let s λ
= ( x 0 , x 1 ,λ 1 , . . .
, x d,λ d , y ) and s be one sample.
We denote the features by x λ = ( x 0 , x 1 ,λ 1 , . . .
, x d,λ d ) and the label by y .
Define the matrices
[Equation]
i ∂λ 1 | λ
=
⃗
[Equation]
x
[Equation]
λ
[Equation]
i ∂λ
[Equation]
| λ = ⃗· · · ∂ 2 x d
[Equation]
λd ∂λ i ∂λ
| λ = ⃗...
· · · ∂ 2 x d
[Equation]
λd ∂λ i ∂λ
[Equation]
| λ
[Equation]
⃗
[Equation]
  (19) where ⃗ 0 ∈ R d denoted by column vector and e i is a vector whose i -th component is 1 andotherwise.
Let l ( s λ , θ ) =
y log( f θ ( x λ ))
+ (1 − y ) log(
− f θ ( x λ )) .
Denote l θ ( λ ) =
l ( s λ , θ ) .
Using
Taylor expansion of the loss l around λ , we have
[Equation]
Note that
[Equation]
λ ) ∂x i,λ i y − f θ ( x λ ) (1 − f θ ( x λ ))
f θ ( x λ ) (21) and ∂f θ ( x λ ) ∂x i,λ i =
∂σ ( g θ ( x λ ))
∂x i,λ i = ∂g θ
( x λ ) ∂x i,λ i σ ( g θ ( x λ ))
(1 − σ ( g θ ( x λ )))
=
∂ ( ∇ g Tθ x λ ) ∂x i,λ i σ ( g θ ( x λ ))
(1 − σ ( g θ ( x λ )))
= ( ∂ ∇ g
Tθ ∂x i,λ i x λ + ∇ g Tθ ∂x λ ∂x i,λ i ) σ ( g θ ( x λ ))
(1 − σ ( g θ ( x λ )))
= ∇ g T θ e i σ ( g θ ( x λ ))
(1 − σ ( g θ ( x λ ))) .
Since the i -th feature x i,λ i of x λ depends on { λ 1 , . .
, λ i } , we have
[Equation]
Thus we have d (cid:88)
[Equation]
Hence we have
[Equation]
Note that ∥ y − f θ ( x ))
∥ ≤ 1 .
Now we consider the second partial derivative of the loss function l θ ( λ ) .
[Equation]
We will put (Eq. 26) into (Eq. 20) to calculate the Taylor loss explicitly.
For the first term, we have d (cid:88) i =
[Equation]
i
[Equation]
(27) and for the second term, we have d (cid:88)
j =
[Equation]
(cid:12)
[Equation]
(cid:12)
[Equation]
= ⃗= d (cid:88)
j = λ j d (cid:88) i =
j ∇ g
Tθ e i ∂x i,λ i ∂λ
[Equation]
By combining (Eq. 27 and 28), we have
[Equation]
The last inequality holds due to
[Equation]
By (Eq. 20, 25 and 29), the conclusion holds.
A. P ROOF OF T HEOREM 3.
We start with a basic inequality frequently used in the proofs
[Equation]
Lemma A.2.
(Supremum inequality) Let f and g be functions which have the same domain and range.
Then
[Equation]
Proof.
[Equation]
Thus the conclusion holds.
Notation.
We assume that the distribution P is parametrized by θ ∗ on the sample space S .
Let { s i } i ∈
[0: N ] be the collection of samples from the distribution P .
We set:
[Equation]
Assumption 1.
Assume that the loss function l satifies Lipschitz condition with respect to the norm.
Proof of Theorem 3.2 .
[Equation]
where
[Equation]
We get
[Equation]
34) where we have
[Equation] [Equation]
Hence, from (Eq. 34 and 35)
[Equation] [Equation]
By McDiarmid’s inequality, in terms of the probability
P (
N
[Equation]
N
[Equation]
u 4 has the following bound with probability at least 1 − δ
[Equation]
Moreover, Rademacher complexity holds for u 2 , so we have
[Equation]
with probability at least 1 − δ .
By (Eq. 38 and 39), we get the following inequality
[Equation]
with probability at least 1 − δ where
[Equation]
where ϵ i is a Radamacher variable for all i ∈
[ N ] .
Since ˆ θ aug is an optimal parameter for
[Equation]
E
[Equation]
∼D [
[Equation]
s i
[Equation]
λ , θ )] , then
[Equation]
From (Eq. 47, 40 and 41)
[Equation]
we conclude that
[Equation]
Now we will prove that
[Equation]
Since
[Equation] [Equation]
We will show E λ ∼D [ ∥ s i,λ − s ∥ ] ≤ 2 dem .
Let each sample s ( o r s i ) ∈
R d +1 × { 0 , 1 , . . . , k } .
Then s =
( x 0 , x 1 , . . .
, x d , y ) .
By the augmentation method, recursively applying convex combinations, we have s λ =
( x 0 , x 1 ,λ 1 , x 2 ,λ 2 , . . .
, x d,λ d , y ) .
By Theorem 3.1 (Eq. 4), each E λ 1 ,...,λ j [ ∥ ( x j,λ j − x j ) ∥ ] ≤ 2 λ j m. Hence
E λ ∼D [ ∥ s i,λ − s ∥ ] ≤ [Equation] (cid:88)
[Equation]
where e = E [ D ] , d + 1 is the dimension of the time series sample, and m = max i ∈ [0: N ] {∥ x i ∥} .
A. P ROOF OF T HEOREM 3.
Let A = sup s ∈ S ∥
A ∥ F and B i = sup s ∈ S
∥ B i ∥ F .
Then for each s ∼ P , we have: ∥ A ∥ F ≤ A and ∥ B i ∥ F ≤ B i , where A and B
i depend on s for i ∈ [ d ] .
Please refer to (Eq. 18) and (Eq. 19).
Proof of Theorem 3.4 .
The proof is the almost same with the proof of Theorem 3.2.
We only describe the part should be replaced in order to prove Theorem 3.4.
Similarly, We start with the decomposition of the equation as follows
[Equation]
where u 1 , u 2 , u 3 , u 4 and u 5 are defined in (Eq. 33).
(Eq. 35) in the proof of Theorem 3.2 will be replaced with the following
[Equation]
Hence, from (Eq. 34) and (Eq. 46), we have
[Equation]
The last two lines of (Eq. 44) will be replaced with the following
[Equation]
Theorem 3.3 guarantees the inequality.
Thus the conclusion holds.
A. P ROOF OF T HEOREM 3.
Asymptotic Results.
Note that the sample space is contained in R d
+1 × { 0 , . . .
, k } and the parameter space Θ ⊆ R p where { 0 , . .
. , k } is the label set.
Under regularity conditions, it is well known that ˆ θ is asymptotically normal with covariance given by the inverse Fisher information matrix.
We will see that ˆ θ aug is also asymptotically normal with the covariance.
{+Suppose that we observe a set { s 0 , s 1 , . . . , s N } of N + 1 samples from the underlying sample space S . Using our RIM method, we can augment the observed sample s i with a distribution D , which results in the set of augmented samples { s i,λ | λ ∼ D} for s i . We then decompose ∪ Ni =
+}
{ s i,λ | λ ∼ D} into disjoint union of some sets S
i such that s i ∈ S i .
Assumption 2.
(Disjointness) the sample space S is the disjoint countable union of all possible augmented sample spaces.
Consider the probability space is ( S , F , P ) where F is a sigma algebra and P the corresponding probability measure.
Let µ be a measurable function from S to R p for some p ∈ N .
For each sample s =
( x, y ) ∈ S , define µ ( s ) =
E [ µ | S i ] where s ∈ S
i .
Let’s assume that we observe N + 1 samples { s 0 , s 1 , . . .
, s N } from the underlying sample space.
Then by Assumption 2, the underlying sample space is decomposed into ∪ ∞
i =1 S i .
i,e S = ∪ ∞ i
=1 S i .
This is well-defined by Assumption 2, and µ is a measurable function.
Let µ i be the expectation value of µ over S i .
Lemma A.3.
(Effects of the average function) With notation as above, the following holds.
The law of total expectation: E s ∼P [ µ ] =
E s ∼P [ µ ] .
The law of total covariance:
Cov s ∼P µ = E s ∼P
[Cov( µ | µ )]
+ Cov s ∼P µ .
Proof.
From the disjointedness of the underlying sample space, for each s ∈ S , we have s ∈ S
i for some i ∈ N
[Equation]
Thus the law of total expectation and the law of total covariance naturally follow.
Under mild assumptions for a given loss function, we show that the average loss function l aug inherits the same properties from the non augmented loss function, where l aug ( s, θ ) = E λ ∼D [ l ( s λ , θ )] .
Assumption 3.
(Regularity of the loss function)
For the loss function l ( · , θ ) , we assume that
For the minimizer θ ∗ of the population risk and any ϵ > 0 , we have
[Equation]
For every ϵ > 0 , there exists a function l
′ ∈
L 2 ( P ) such that for almost every s and for every θ 1 , θ 2 ∈ N ( θ 0 , ϵ ) , we have
[Equation]
Uniform weak law of large number holds
[Equation]
For each θ in Θ , the map s → l ( s, θ ) is measurable The map θ → l ( s, θ ) is
differentiable at θ ∗ for almost every s The map θ
→
E s ∼P [ l ( s, θ ) ] admits a second-order Taylor expansion at θ ∗ with nonsingular second derivatives matrix V θ ∗
Proposition A.4.
For the pair ( θ aug , l aug ) , the following property holds.
For every ϵ > 0 , there exists a function l ′
aug ∈
L 2 ( P ) such that for almost every s and for every θ 1 , θ 2 ∈ N ( θ 0 , ϵ ) , we have
[Equation]
Proof.
Since we have
[Equation]
the conclusion holds and l ′ aug
= E λ ∼D [ l ′ ( s λ )] .
Proposition A.5.
For the pair ( θ aug , l aug ) , the following property holds.
[Equation]
Proof.
We have
[Equation]
where the last equality holds because the underlying sample space S is the disjoint countable union of all possible augmented sample spaces.
Proposition A.6.
For the pair ( θ aug , l aug ) , the following property holds.
For each θ in Θ , the map s → l aug ( s, θ ) is measurable
Proof.
l aug is measurable since l is measurable and l aug ( s, θ ) =
E λ ∼D
[ l ( s λ , θ )] .
Proposition A.7.
For the pair ( θ aug , l aug ) , the following property holds.
For each θ in Θ , the map s → l aug ( s, θ ) is differentiable
Proof.
we have
[Equation]
Let us define
F
[Equation] θ ∗ )) | ] for all s ∈ S Since | F δ ( s ) | ≤ G ( s ) for all s ∈ S by Lebesgue’s dominated convergence theorem,
[Equation]
where the last inequality holds because l is differentiable.
Proposition A.8.
The map θ → E s ∼P [ l aug ( s, θ )] admits a second-order Taylor expansion at θ ∗ with non-singular second derivatives matrix V θ ∗
Proof.
By the total law of expectation of Lemma A.3, we get
[Equation]
Hence the conclusion holds by the bullet 6 from Assumption 3.
Combining all the Propositions [A.4 - A.8] with some results shown in Van der Vaart (1998), we prove Theorem 3.5.
Proof of Theorem 3.5 .
The results for ˆ θ have already been proven in (Van der Vaart, 1998, Theorem 5.23).
The Propositions [A.4 - A.8] guarantee that (Van der Vaart, 1998, Theorem 5.23) can be applied to the pairs ( θ ∗ , l ) and ( θ aug , l aug ) .
Therefore ˆ θ aug is asymptotically normal and satisfies (Eq. 10).
Let X = ∇ l ( s, θ ∗ ) − ∇ l aug ( s, θ ∗ ) . Recall that Cov s ∼P µ = E s ∼P
[Cov( µ | µ )]
+ Cov s ∼P µ by Lemma A.3. Let’s consider µ and µ to be ∇ l ( s, θ ∗ ) and ∇ l aug ( s, θ ∗ ) , respectively. Then
[Equation]
and Σ
[Equation]
=
[Equation]
Hence we have
[Equation] Thus we get [Equation] Since tr ( E s ∼P [ XX T ]) ≥ 0 , we have RE = tr (Σ 0 ) tr (Σ aug ) ≥
B V ISUALIZATIONS OF RIM T IME GAN GENERATED TIME SERIES
This sections shows visualization of time series generated by RIM and TimeGAN.
We plot samples from original time series, RIM generated time series and TimeGAN generated time series from both classes for Synthetic exponential ODE classification in Figure 6. [Figure] C A BLATION ANALYSIS [Figure]
[Figure]
D T IME SERIES FORECASTING
In this section, we consider time series forecasting task where we use previous n time steps data to predict next times step data.
We compare performances of regression model trained with original dataset and regression models trained with augmented dataset using RIM.
Predicting Stock Price Movement.
This regression task consists of predicting the next day SPY500 index Open price from historical SPY500 index using data from July 2008 to December 2012 as training data and data from January 2013 to March 2014 as testing data.
The input data contains the last 7 days’ historical Open, Close, High, Low, and Volume of the SPY500 index.
After predicting the next day’s Open price, we take a long position if the predicted next day Open is larger than today’s Open, short otherwise.
On comparing the results on the test data for the augmented case and the original case, we observe that the proportion of profitable trading signals is higher in the augmentation-trained model as observed in Figure 9.
Using these trading signals, we also calculate the trading system’s CAGR (Compound Annual Growth Rate) which we observe to be higher in the augmentation trained model.
The test loss plot shows that the MSE for the augmentation trained model is consistently lower than the non-augmentation trained model. [Figure] P r o p o r t i o n o f
C o rr e c t T r a d i n g S
i g n a l
[Figure]
Predicting Air Quality.
The restricted air quality dataset contains 1200 instances of hourly averaged responses from an array of 5 metal oxide chemical sensors.
This is a time series regression task where the target is the next time step’s CO concentration.
The input data contains the last six time steps’ 10 features as used in De Vito et al.
(2008) and for Machine Learning & Repository.
Figure 10 shows that the test MSE of the augmentation trained model remains lower than the non-augmentation trained model during the training epochs validating our claims about the robustness of the approach.
Accordingly, the proportion of correct predictions of CO up/down also remains higher for the augmented case.
[Figure]
T e s t l o
[Figure]
augnon
[Figure]
E T IME SERIES RL
In this section, we consider portfolio management task using reinforcement learning.
More specifically, we compare performances of agents (DPG) trained with original state trajectories (price evolution) and augmented state trajectories using RIM.
E. D ATASET
For RL, the data comes from the Quandl finance database that has daily data.
Our RL models are trained over 600 trading days from 2010-08-09 to 2012-12-25 and tested over 200 trading days from 2012-12-26 to 2013-10-11 on a portfolio consisting of ten selected stocks: American Tower Corp.
(AMT), American Express Company (AXP), Boeing Company (BA), Chevron Corporation (CVX),
Johnson & Johnson (JNJ), Coca-Cola Co (KO), McDonald’s Corp. (MCD), Microsoft Corporation (MSFT), AT&T Inc. (T) and Walmart Inc (WMT).
To promote the diversification of the portfolio, these stocks were selected from different sectors of the S&P 500, so that they are uncorrelated as much as possible as shown in Fig.
E.
RL P SEUDOCODE
E. P OLICY D EPLOYMENT
In our RL experiments, the investment decisions to rebalance the portfolio are made daily and each input signal represents a multidimensional tensor that aggregates historical open, low, high, close prices and volume.
It should be noted that our training and testing include the transaction costs (TC).
We used the typical cost due to bid-ask spread and market impact that is 0.25%.
We believe these are reasonable transaction costs for the portfolio trades.
[Figure]
F H YPERPARAMETERS
We note that the primary objective of the conducted experiments is to show that RIM can improve model performance.
Therefore, in all experiments, instead of finding optimal set of parameters for augmented and non-augmented trained model, we compare the performance of augmented trained model and non-augmented trained model with the same hyperparameter configuration.
We demonstrated in Section 4 that RIM indeed improves model performance with same hyperparameter configuration.
However, are these improvements robust to other hyperparameters?
To answer this question, we conducted sensitivity analysis for two supervised learning tasks (Indoor user movement classification and Air Quality regression) and RL task (Portfolio Management).
F. H YPERPARAMETER S ENSITIVITY FOR S UPERVISED T ASKS
For Indoor movement classification task, we conducted the same experiment in Section 4 with 9 different hyperparameter configurations as shown in table 1 and observed that for all the cases RIM outperforms Non-Augmented case (with smaller mean test loss and higher mean test accuracy) which solidifies our claim of enhancement observed in model performance when we use RIM.
[Table]
For Air quality regression task, we again conducted the same experiment as in Section 4 withdifferent hyperparameter configurations as shown in table 2.
Here too, we find that RIM outperforms
Non-Augmented case (with smaller mean test MSE and higher mean test accuracy) which confirms our claim of enhancement observed in model performance when we use RIM
[Table] [Table]
F. H YPERPARAMETER S ENSITIVITY FOR RL T ASK
The hyperparameter space is represented by a hypercube: the more values it contains the harder it is to explore all the possible combinations.
To efficiently find the optimal set of hperparameters, we explored the hyperparameter space using Bayesian optimization (BO) Hutter et al.
Tableshows the range of values for the hyperparameters used during the training and validation phase.
The learning rate controls the speed at which neural network parameters are updated.
The window is used to allow the deep RL agents to utilize a range of historical data values to relax the Markov assumption.
We allow the use of 2 days up to 30 days of historical data.
The number of filters and kernel strides are the hyperparameters for the convolution neural networks.
It is important to carefully optimize these parameters in order to capture the best feature representations used by the policy networks.
Finally, the training and testing sizes may also impact the RL performance.
So, we also consider them as hyperparameters.
[Table]
The detailed configurations refers to listed
[Table] [Table]