arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network...

14
Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1 , Hsiang-Fu Yu 1 , and Inderjit Dhillon 2 1 Amazon 2 Amazon and UT Austin October 29, 2019 Abstract Forecasting high-dimensional time series plays a crucial role in many applications such as demand forecasting and financial predictions. Modern datasets can have millions of correlated time-series that evolve together, i.e they are extremely high dimensional (one dimension for each individual time-series). There is a need for exploiting global patterns and coupling them with local calibration for better prediction. However, most recent deep learning approaches in the literature are one-dimensional, i.e, even though they are trained on the whole dataset, during prediction, the future forecast for a single dimension mainly depends on past values from the same dimension. In this paper, we seek to correct this deficiency and propose DeepGLO, a deep forecasting model which thinks globally and acts locally. In particular, DeepGLO is a hybrid model that combines a global matrix factorization model regularized by a temporal convolution network, along with another temporal network that can capture local properties of each time-series and associated covariates. Our model can be trained effectively on high-dimensional but diverse time series, where different time series can have vastly different scales, without a priori normalization or rescaling. Empirical results demonstrate that DeepGLO can outperform state-of-the-art approaches; for example, we see more than 25% improvement in WAPE over other methods on a public dataset that contains more than 100K-dimensional time series. 1 Introduction Time-series forecasting is an important problem with many industrial applications like retail demand forecasting [21], financial predictions [15], predicting traffic or weather patterns [5]. In general it plays a key role in automating business processes [17]. Modern data-sets can have millions of correlated time-series over several thousand time-points. For instance, in an online shopping portal like Amazon or Walmart, one may be interested in the future daily demands for all items in a category, where the number of items may be in millions. This leads to a problem of forecasting n time-series (one for each of the n items), given past demands over t time-steps. Such a time series data-set can be represented as a matrix Y R n×t and we are interested in the high-dimensional setting where n can be of the order of millions. Traditional time-series forecasting methods operate on individual time-series or a small number of time-series at a time. These methods include the well known AR, ARIMA, exponential smoothing [19], the classical Box-Jenkins methodology [4] and more generally the linear state-space models [13]. However, these methods are not easily scalable to large data-sets with millions of time-series, owing to the need for individual training. Moreover, they cannot benefit from shared temporal patterns in the whole data-set while training and prediction. Deep networks have gained popularity in time-series forecasting recently, due to their ability to model non-linear temporal patterns. Recurrent Neural Networks (RNN’s) [10] have been popular in sequential modeling, however they suffer from the gradient vanishing/exploding problems in training. Long Short Term Memory (LSTM) [11] networks alleviate that issue and have had great success in langulage modeling and other seq-to-seq tasks [11, 22]. Recently, deep time-series models have used LSTM blocks as internal 1 arXiv:1905.03806v2 [stat.ML] 27 Oct 2019

Transcript of arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network...

Page 1: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

Think Globally, Act Locally: A Deep Neural Network Approachto High-Dimensional Time Series Forecasting

Rajat Sen1, Hsiang-Fu Yu1, and Inderjit Dhillon2

1Amazon2Amazon and UT Austin

October 29, 2019

Abstract

Forecasting high-dimensional time series plays a crucial role in many applications such as demandforecasting and financial predictions. Modern datasets can have millions of correlated time-series thatevolve together, i.e they are extremely high dimensional (one dimension for each individual time-series).There is a need for exploiting global patterns and coupling them with local calibration for better prediction.However, most recent deep learning approaches in the literature are one-dimensional, i.e, even thoughthey are trained on the whole dataset, during prediction, the future forecast for a single dimension mainlydepends on past values from the same dimension. In this paper, we seek to correct this deficiency andpropose DeepGLO, a deep forecasting model which thinks globally and acts locally. In particular, DeepGLOis a hybrid model that combines a global matrix factorization model regularized by a temporal convolutionnetwork, along with another temporal network that can capture local properties of each time-series andassociated covariates. Our model can be trained effectively on high-dimensional but diverse time series,where different time series can have vastly different scales, without a priori normalization or rescaling.Empirical results demonstrate that DeepGLO can outperform state-of-the-art approaches; for example, wesee more than 25% improvement in WAPE over other methods on a public dataset that contains morethan 100K-dimensional time series.

1 Introduction

Time-series forecasting is an important problem with many industrial applications like retail demandforecasting [21], financial predictions [15], predicting traffic or weather patterns [5]. In general it plays a keyrole in automating business processes [17]. Modern data-sets can have millions of correlated time-series overseveral thousand time-points. For instance, in an online shopping portal like Amazon or Walmart, one maybe interested in the future daily demands for all items in a category, where the number of items may bein millions. This leads to a problem of forecasting n time-series (one for each of the n items), given pastdemands over t time-steps. Such a time series data-set can be represented as a matrix Y ∈ Rn×t and we areinterested in the high-dimensional setting where n can be of the order of millions.

Traditional time-series forecasting methods operate on individual time-series or a small number of time-seriesat a time. These methods include the well known AR, ARIMA, exponential smoothing [19], the classicalBox-Jenkins methodology [4] and more generally the linear state-space models [13]. However, these methodsare not easily scalable to large data-sets with millions of time-series, owing to the need for individual training.Moreover, they cannot benefit from shared temporal patterns in the whole data-set while training andprediction.

Deep networks have gained popularity in time-series forecasting recently, due to their ability to modelnon-linear temporal patterns. Recurrent Neural Networks (RNN’s) [10] have been popular in sequentialmodeling, however they suffer from the gradient vanishing/exploding problems in training. Long ShortTerm Memory (LSTM) [11] networks alleviate that issue and have had great success in langulage modelingand other seq-to-seq tasks [11, 22]. Recently, deep time-series models have used LSTM blocks as internal

1

arX

iv:1

905.

0380

6v2

[st

at.M

L]

27

Oct

201

9

Page 2: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

components [9, 20]. Another popular architecture, that is competitive with LSTM’s and arguably easierto train is temporal convolutions/causal convolutions popularized by the wavenet model [24]. Temporalconvolutions have been recently used in time-series forecasting [3, 2]. These deep network based models canbe trained on large time-series data-sets as a whole, in mini-batches. However, they still have two importantshortcomings.

Firstly, most of the above deep models are difficult to train on data-sets that have wide variation in scalesof the individual time-series. For instance in the item demand forecasting use-case, the demand for somepopular items may be orders of magnitude more than those of niche items. In such data-sets, each time-seriesneeds to be appropriately normalized in order for training to succeed, and then the predictions need to bescaled back to the original scale. The mode and parameters of normalization are difficult to choose and canlead to different accuracies. For example, in [9, 20] each time-series is whitened using the correspondingempirical mean and standard deviation, while in [3] the time-series are scaled by the corresponding value onthe first time-point.

Secondly, even though these deep models are trained on the entire data-set, during prediction the modelsonly focus on local past data i.e only the past data of a time-series is used for predicting the future ofthat time-series. However, in most datasets, global properties may be useful during prediction time. Forinstance, in stock market predictions, it might be beneficial to look at the past values of Alphabet, Amazon’sstock prices as well, while predicting the stock price of Apple. Similarly, in retail demand forecasting, pastvalues of similar items can be leveraged while predicting the future for a certain item. To this end, in [16],the authors propose a combination of 2D convolution and recurrent connections, that can take in multipletime-series in the input layer thus capturing global properties during prediction. However, this method doesnot scale beyond a few thousand time-series, owing to the growing size of the input layer. On the other endof the spectrum, TRMF [29] is a temporally regularized matrix factorization model that can express all thetime-series as linear combinations of basis time-series. These basis time-series can capture global patternsduring prediction. However, TRMF can only model linear temporal dependencies. Moreover, there can beapproximation errors due to the factorization, which can be interpreted as a lack of local focus i.e the modelonly concentrates on the global patterns during prediction.

In light of the above discussion, we aim to propose a deep learning model that can think globally and act locallyi.e., leverage both local and global patterns during training and prediction, and also can be trained reliablyeven when there are wide variations in scale. The main contributions of this paper are as follows:

• In Section A, we discuss issues with wide variations in scale among different time-series, and proposea simple initialization scheme, LeveledInit for Temporal Convolution Networks (TCN) that enablestraining without apriori normalization.

• In Section 5.1, we present a matrix factorization model regularized by a TCN (TCN-MF), that canexpress each time-series as linear combination of k basis time-series, where k is much less than the numberof time-series. Unlike TRMF, this model can capture non-linear dependencies as the regularization andprediction is done using a temporal convolution trained concurrently and also is amicable to scalablemini-batch training. This model can handle global dependencies during prediction.

• In Section 5.2, we propose DeepGLO, a hybrid model, where the predictions from our global TCN-MFmodel, is provided as covariates for a temporal convolution network, thereby enabling the final modelto focus both on local per time-series properties as well as global dataset wide properties, while bothtraining and prediction.

• In Section 6, we show that DeepGLO outperforms other benchmarks on four real world time-seriesdata-sets, including a public wiki dataset which contains more than 110K dimensions of time series.More details can be found in Tables 1 and 2.

2 Related Work

The literature on time-series forecasting is vast and spans several decades. Here, we will mostly focus onrecent deep learning approaches. For a comprehensive treatment of traditional methods, we refer the readersto [13, 19, 4, 18, 12] and the references there in.

2

Page 3: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

In recent years deep learning models have gained popularity in time-series forecasting. DeepAR [9] proposesa LSTM based model where parameters of Bayesian models for the future time-steps are predicted as afunction of the corresponding hidden states of the LSTM. In [20], the authors combine linear state spacemodels with deep networks. In [26], the authors propose a time-series model where all history of a time-seriesis encoded using an LSTM block, and a multi horizon MLP decoder is used to decode the input into futureforecasts. LSTNet [16] can leverage correlations between multiple time-series through a combination of 2Dconvolution and recurrent structures. However, it is difficult to scale this model beyond a few thousandtime-series because of the growing size of the input layer. Temporal convolutions have been recently used fortime-series forecasting [3].

Matrix factorization with temporal regularization was first used in [27] in the context of speech de-noising.A spatio-temporal deep model for traffic data has been proposed in [28]. Perhaps closest to our work isTRMF [29], where the authors propose an AR based temporal regularization. In this paper, we extend thiswork to non-linear settings where the temporal regularization can be performed by a temporal convolutionnetwork (see Section 4). We further combine the global matrix factorization model with a temporal convolutionnetwork, thus creating a hybrid model that can focus on both local and global properties. There has been aconcurrent work [25], where an RNN has been used to evolve a global state common to all time-series.

3 Problem Setting

We consider the problem of forecasting high-dimensional time series over future time-steps. High-dimensionaltime-series datasets consist of several possibly correlated time-series evolving over time along with corre-sponding covariates, and the task is to forecast the values of those time-series in future time-steps. Before,we formally define the problem, we will set up some notation.

Notation: We will use bold capital letters to denote matrices such as M ∈ Rm×n. Mij and M[i, j] willbe used interchangeably to denote the (i, j)-th entry of the matrix M. Let [n] , {1, 2, ..., n} for a positiveinteger n. For I ⊆ [m] and J ⊆ [n], the notation M[I,J ] will denote the sub-matrix of M with rows in Iand columns in J . M[:,J ] means that all the rows are selected and similarly M[I, :] means all the columnsare chosen. J + s denotes all the set of elements in J increased by s. The notation i : j for positive integersj > i, is used to denote the set {i, i + 1, ..., j}. ‖M‖F , ‖M‖2 denote the Frobenius and Spectral normsrespectively. We will also define 3-dimensional tensor notation in a similar way as above. Tensors will also berepresented by bold capital letters T ∈ Rm×r×n. Tijk and T[i, j, k] will be used interchangeably to denote the(i, j, k)-th entry of the tensor T. For I ⊆ [m], J ⊆ [n] and K ⊆ [r], the notation T[I,K,J ] will denote thesub-tensor of T, restricted to the selected coordinates. By convention, all vectors in this paper are row vectorsunless otherwise specified. ‖v‖p denotes the p-norm of the vector v ∈ R1×n. vI denotes the sub-vector withentries {vi : ∀i ∈ I} where vi denotes the i-th coordinate of v and I ⊆ [n]. The notation vi:j will be used todenote the vector [vi, ..., vj ]. The notation [v;u] ∈ R1×2n will be used to denote the concatenation of two rowvectors v and u. For a vector v ∈ R1×n, µ(v) , (

∑i vi)/n denotes the empirical mean of the coordinates

and σ(v) ,√

(∑i(vi − µ(v)2))/n denotes the empirical standard deviation.

Forecasting Task: A time-series data-set consists of the raw time-series, represented by a matrixY = [Y(tr)Y(te)], where Y(tr) ∈ Rn×t, Y(te) ∈ Rn×τ , n is the number of time-series, t is the numbertime-points observed during training phase, τ is the window size for forecasting. y(i) is used to denote thei-th time series, i.e., the i-th row of Y. In addition to the raw time-series, there may optionally be observedcovariates, represented by the tensor Z ∈ Rn×r×(t+τ). z(i)

j = Z[i, :, j] denotes the r-dimensional covariates fortime-series i and time-point j. Here, the covariates can consist of global features like time of the day, day ofthe week etc which are common to all time-series, as well as covariates particular to each time-series, forexample vectorized text features describing each time-series. The forecasting task is to accurately predict thefuture in the test range, given the original time-series Y(tr) in the training time-range and the covariates Z.Y(te) ∈ Rn×τ will be used to denote the predicted values in the test range.

Objective: The quality of the predictions are generally measured using a metric calculated between thepredicted and actual values in the test range. One of the popular metrics is the normalized absolute deviation

3

Page 4: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

OutputDilation = 24�1 = 8

<latexit sha1_base64="Er/nZLuW9rm1wgPELBIHdXDIbUM=">AAACB3icbVDLSsN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Y4CTjvB5G7ud6ZUKhaLRz1LqB/hkWAhI1gbya/1Q4lJ5uaZl9cGdtWpOwugdeIWpAoFmgP7qz+MSRpRoQnHSvVcJ9F+hqVmhNO80k8VTTCZ4BHtGSpwRJWfLY7O0YVRhiiMpSmh0UL9PZHhSKlZFJjOCOuxWvXm4n9eL9XhjZ8xkaSaCrJcFKYc6RjNE0BDJinRfGYIJpKZWxEZYxODNjlVTAju6svrpO3V3au69+BVG7dFHGU4g3O4BBeuoQH30IQWEHiCZ3iFN2tqvVjv1seytWQVM6fwB9bnD/b7kZE=</latexit>

(a)

n

t

=

k

k

F

X(tr) X(te)

Y

tr te

t ⌧

(b)

Figure 1: Fig. 1a contains an illustration of a TCN. Note that the base image has been borrowed from [24]. Thenetwork has d = 4 layers, with filter size k = 2. The network maps the input yt−l:t−1 to the one-shifted outputyt−l+1:t. Figure 1b presents an illustration of the matrix factorization approach in time-series forecasting. The Y(tr)

training matrix can be factorized into low-rank factors F (∈ Rn×k) and X(tr) ( ∈ Rk×t). If X(tr) preserves temporalstructures then the future values X(te) can be predicted by a time-series forecasting model and thus the test periodpredictions can be made as FX(te).

metric [29], defined as follows,

L(Y (obs), Y (pred)) =

∑ni=1

∑τj=1 |Y

(obs)ij − Y (pred)

ij |∑ni=1

∑τj=1 |Y

(obs)ij |

, (1)

where Y (obs) and Y (pred) are the observed and predicted values, respectively. This metric is also referred toas WAPE in the forecasting literature. Other commonly used evaluation metrics are defined in Section C.2.Note that (1) is also used as a loss function in one of our proposed models. We also use the squared-lossL2(Y (obs), Y (pred)) = (1/nτ)

∥∥Y (obs) − Y (pred)∥∥2

F, during training.

4 LeveledInit: Handling Diverse Scales with TCN

In this section, we propose LeveledInit a simple initialization scheme for Temporal Convolution Networks(TCN) [2] which is designed to handle high-dimensional time-series data with wide variation in scale, withoutapriori normalization. As mentioned before, deep networks are difficult to train on time-series datasets,where the individual time-series have diverse scales. LSTM based models cannot be reliably trained on suchdatasets and may need apriori standard normalization [16] or pre-scaling of the bayesian mean predictions [9].TCN’s have also been shown to require apriori normalization [3] for time-series predictions. The choice ofnormalization parameters can have a significant effect on the prediction performance. Here, we show thata simple initialization scheme for the TCN network weights can alleviate this problem and lead to reliabletraining without apriori normalization. First, we will briefly discuss the TCN architecture.

Temporal Convolution: Temporal convolution (also referred to as Causal Convolution) [24, 3, 2] aremulti-layered neural networks comprised of 1D convolutional layers with dilation. The dilation in layer i isusually set as dil(i) = 2i−1. A temporal convolution network with filter size k and number of layers d has adynamic range (or look-back) of l′ := 1 + l = 1 + 2(k − 1)2d−1. Note that it is assumed that the stride is 1 inevery layer and layer i needs to be zero-padded in the beginning with (k − 1)dil(i) zeros. An example of atemporal convolution network with one channel per layer is shown in Fig. 1a. For more details, we refer thereaders to the general description in [2]. Note that in practice, we can have multiple channels per layer of a TCnetwork. The TC network can thus be treated as an object that takes in the previous values of a time-series yJ ,where J = {j − l, j − l + 1, · · · , j − 1} along with the past covariates zJ , corresponding to that time-seriesand outputs the one-step look ahead predicted value yJ+1. We will denote a temporal convolution neuralnetwork by T (·|Θ), where Θ is the parameter weights in the temporal convolution network. Thus, we haveyJ+1 = T (yJ , zJ |Θ). The same operators can be defined on matrices. Given Y ∈ Rn×t,Z ∈ Rn×r×(t+τ)

and a set of row indices I = {i1, ..., ibn} ⊂ [n], we can write Y[I,J + 1] = T (Y[I,J ],Z[I, :,J ]|Θ).

LeveledInit Scheme: One possible method to alleviate the issues with diverse scales, is to start with initialnetwork parameters, that results in approximately predicting the average value of a given window of past

4

Page 5: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

time-points yj−l:j−1, as the future prediction yj . The hope is that, over the course of training, the networkwould learn to predict variations around this mean prediction, given that the variations around this mean isrelatively scale free. This can be achieved through a simple initialization scheme for some configurations ofTCN, which we call LeveledInit. For ease of exposition, let us consider the setting without covariates andonly one channel per layer, which can be functionally represented as yJ+1 = T (yJ |Θ). In this case, theinitialization scheme is to simply set all the filter weights to 1/k, where k is the filter size in every layer. Thisresults in a proposition.Proposition 1 (LeveledInit). Let T (·|Θ) be a TCN with one channel per layer, filter size k = 2, numberof layers d. Here Θ denotes the weights and biases of the network. Let [yj−l+1, · · · , yj ] := T (yJ |Θ) forJ = {j − l, ...., j − 1} and l = 2(k − 1)2d−1. If all the biases in Θ are set to 0 and all the weights set to 1/kthen, yj = µ(yJ ) if y ≥ 0 and all activation functions are ReLUs.

The above proposition shows that LeveledInit results in a prediction yj , which is the average of the past ltime-points, where l is the dynamic range of the TCN, when filter size is k = 2 (see Fig. 1a). The proofof proposition 1 (see Section A)) follows from the fact that an activation value in an internal layer is theaverage of the corresponding k inputs from the previous layer, and an induction on the layers yields theresults. LeveledInit can also be extended to the case with covariates, by setting the corresponding filterweights to 0 in the input layer. It can also be easily extended to multiple channels per layer with k = 2. InSection 6, we show that a TCN with LeveledInit can be trained reliably without apriori normalization, on realworld datasets, even for values of k 6= 2. We provide the psuedo-code for training a TCN with LeveledInit asAlgorithm 1.

Note that we have also experimented with a more sophisticated variation of the Temporal Convolutionarchitecture termed as Deep Leveled Network (DLN ), which we include in Appendix A. However, we observedthat the simple initialization scheme for TCN (LeveledInit) can match the performance of the Deep Levelednetwork.

5 DeepGLO: A Deep Global Local Forecaster

In this section we will introduce our hybrid model DeepGLO, that can leverage both global and local features,during training and prediction. In Section 5.1, we present the global component, TCN regularized MatrixFactorization (TCN-MF). This model can capture global patterns during prediction, by representing each ofthe original time-series as a linear combination of k basis time-series, where k � n. In Section 5.2, we detailhow the output of the global model can be incorporated as an input covariate dimension for a TCN, thusleading to a hybrid model that can both focus on local per time-series signals and leverage global datasetwide components.

Algorithm 1 Mini-batch Training for TCNwith LeveledInitRequire: learning rate η, horizontal batch size bt, vertical

batch size bn, and maxiters1: Initialize T (·|Θ) according to LeveledInit2: for iter = 1, · · · , maxiters do3: for each batch with indices I and J in an epoch

do4: I = {i1, ..., ibn} and J ={j + 1, j + 2, ..., j + bt}

5: Y ← T (Y[I,J ],Z[I, :,J ]|Θ)

6: Θ← Θ− η ∂ΘL(Y[I,J + 1], Y)

7: end for8: end for

Algorithm 2 Temporal Matrix FactorizationRegularized by TCN (TCN-MF)Require: itersinit, iterstrain, itersalt.1: /* Model Initialization */2: Initialize TX(·) by LeveledInit3: Initialize F and X(tr) by Alg 3 for itersinit iterations.4: /* Alternate training cycles */5: for iter = 1, 2, ..., itersalt do6: Update F and X(tr) by Alg 3 for iterstrain itera-

tions7: Update TX(·) by Alg 1 on X(tr) for iterstrain iter-

ations, with no covariates.8: end for

5.1 Global: Temporal Convolution Network regularized Matrix Factorization(TCN-MF)

In this section we propose a low-rank matrix factorization model for time-series forecasting that uses aTCN for regularization. The idea is to factorize the training time-series matrix Y(tr) into low-rank factorsF ∈ Rn×k and X(tr) ∈ Rk×t, where k � n. This is illustrated in Figure 1b. Further, we would like to

5

Page 6: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

encourage a temporal structure in X(tr) matrix, such that the future values X(te) in the test range can also beforecasted. Let X = [X(tr)X(te)]. Thus, the matrix X can be thought of to be comprised of k basis time-seriesthat capture the global temporal patterns in the whole data-set and all the original time-series are linearcombinations of these basis time-series. In the next subsection we will describe how a TCN can be used toencourage the temporal structure for X.

Temporal Regularization by a TCN: If we are provided with a TCN that captures the temporal patternsin the training data-set Y(tr), then we can encourage temporal structures in X(tr) using this model. Let usassume that the said network is TX(·). The temporal patterns can be encouraged by including the followingtemporal regularization into the objective function:

R(X(tr) | TX(·)) :=1

|J |L2 (X[:,J ], TX (X[:,J − 1])) , (2)

where J = {2, · · · , t} and L2(·, ·) is the squared-loss metric, defined before. This implies that the values ofthe X(tr) on time-index j are close to the predictions from the temporal network applied on the past valuesbetween time-steps {j − l, ..., j − 1}. Here, l + 1 is equal to the dynamic range of the network defined inSection 4. Thus the overall loss function for the factors and the temporal network is as follows:

LG(Y(tr),F,X(tr), TX) := L2

(Y(tr),FX(tr)

)+ λTR(X(tr) | TX(·)), (3)

where λT is the regularization parameter for the temporal regularization component.

Training: The low-rank factors F,X(tr) and the temporal network TX(·) can be trained alternatively toapproximately minimize the loss in Eq. (3). The overall training can be performed through mini-batch SGDand can be broken down into two main components performed alternatingly: (i) given a fixed TX(·) minimizeLG(F,X(tr), TX) with respect to the factors F,X(tr) - Algorithm 3 and (ii) train the network TX(·) on thematrix X(tr) using Algorithm 1.

The overall algorithm is detailed in Algorithm 2. The TCN TX(·) is first initialized by LeveledInit. Then inthe second initialization step, two factors F and X(tr) are trained using the initialized TX(·) (step 3), foritersinit iterations. This is followed by the itersalt alternative steps to update F, X(tr), and TX(·) (steps5-7).

Prediction: The trained model local network TX(·) can be used for multi-step look-ahead prediction ina standard manner. Given the past data-points of a basis time-series, xj−l:j−1, the prediction for the nexttime-step, xj is given by [xj−l+1, · · · , xj ] := TX(xj−l:j−1) Now, the one-step look-ahead prediction can beconcatenated with the past values to form the sequence xj−l+1:j = [xj−l+1:j−1xj ], which can be again passedthrough the network to get the next prediction: [· · · , xj+1] = TX(xj−l+1:j). The same procedure can berepeated τ times to predict τ time-steps ahead in the future. Thus we can obtain the basis time-series in thetest-range X(te). The final global predictions are then given by Y(te) = FX(te).Remark 1. Note that TCN-MF can perform rolling predictions without retraining unlike TRMF. We providemore details in Appendix B, in the interest of space.

Algorithm 3 Training the Low-rank factorsF,X(tr) given a fixed network TX(·), for oneepochRequire: learning rate η, a TCN TX(·).1: for each batch with indices I and J in an epoch do2: I = {i1, ..., ibn} and J = {j + 1, j + 2, ..., j + bt}3: X[:,J ] ← X[:,J ] − η ∂

∂X[:,J ]LG(Y[I,J ],F[I, :

],X[:,J ], TX)4: F[I, :] ← F[I, :] − η ∂

∂F[I,:]LG(Y[I,J ],F[I, :],X[:

,J ], TX)5: end for

Algorithm 4 DeepGLO- Deep Global LocalForecaster1: Obtain global F, X(tr) and TX(·) by Alg 2.2: Initialize TY (·) with number of inputs r + 2 and Lev-

eledInit.3: /* Training hybrid model */4: Let Y(g) be the global model prediction in the training

range.5: Create covariates Z′ ∈ Rn×(r+1)×t s.t Z′[:, 1, :] =

Y(g) and Z′[:, 2 : r + 1, :] = Z[:, :, 1 : t].6: Train TY (·) using Algorithm 1 with time-series Y(tr)

and covariates Z′.

6

Page 7: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

.

.

.

X(tr) X(te)

⇥f(i)1

⇥f(i)2

⇥f(i)k

(a)

Global Pred.

tetr

(b)

Figure 2: In Fig. 2a, we show some of the basis time-series extracted from the traffic dataset, which can be combinedlinearly to yield individual original time-series. It can be seen that the basis series are highly temporal and can bepredicted in the test range using the network TX(·|ΘX). In Fig. 2b (base image borrowed from [24]), we show anillustration of DeepGLO. The TCN shown is the network TY (·), which takes in as input the original time-points,the original covariates and the output of the global model as covariates. Thus this network can combine the localproperties with the output of the global model during prediction.

Table 1: Data statistics and Evaluation settings. In the rolling Pred., τw denotes the number of time-points in eachwindow and nw denotes the number of rolling windows. std({µ}) denotes the standard deviation among the meansof all the time series in the data-set i.e std({µ}) = std({µ(y(i))}ni=1). Similarly, std({std}) denotes the standarddeviation among the std. of all the time series in the data-set i.e std({std}) = std({std(y(i))}ni=1). It can be seen thatthe electricity and wiki datasets have wide variations in scale.

Data n t τw nw std({µ(yi)}) std({std(yi)})electricity 370 25,968 24 7 1.19e4 7.99e3

traffic 963 10,392 24 7 1.08e−2 1.25e−2

wiki 115,084 747 14 4 4.85e4 1.26e4

PeMSD7(M) 228 11,232 9 160 3.97 4.42

5.2 Combining the Global Model with Local Features

In this section, we present our final hybrid model. Recall that our forecasting task has as input the trainingraw time-series Y(tr) and the covariates Z ∈ Rn×r×(t+τ). Our hybrid forecaster is a TCN TY (·|ΘY ) with ainput size of r+2 dimensions: (i) one of the inputs is reserved for the past points of the original raw time-series,(ii) r inputs for the original r-dimensional covariates and (iii) the remaining dimension is reserved for theoutput of the global TCN-MF model, which is fed as input covariates. The overall model is demonstrated inFigure 2. The training pseudo-code for our model is provided as Algorithm 4.

Therefore, by providing the global TCN-MF model prediction as covariates to a TCN, we can make the finalpredictions a function of global dataset wide properties as well as the past values of the local time-series andcovariates. Note that both rolling predictions and multi-step look-ahead predictions can be performed byDeepGLO, as the global TCN-MF model and the hybrid TCN TY (·) can perform the forecast, without anyneed for re-training. We illustrate some representative results on a time-series from the dataset in Fig. 2.In Fig. 2a, we show some of the basis time-series (global features) extracted from the traffic dataset, whichcan be combined linearly to yield individual original time-series. It can be seen that the basis series arehighly temporal and can be predicted in the test range using the network TX(·|ΘX). In Fig. 2b, we illustratethe complete architecture of DeepGLO. It can be observed that the output of the global TCN-MF model isinputted as a covariate to the TCN TY (·), which inturn combines this with local features, and predicts in thetest range through multi-step look-ahead predictions.

7

Page 8: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

Table 2: Comparison of algorithms on normalized and unnormalized versions of data-sets on rolling prediction tasksThe error metrics reported are WAPE/MAPE/SMAPE (see Section C.2). TRMF is retrained before every predictionwindow, during the rolling predictions. All other models are trained once on the initial training set and used forfurther prediction for all the rolling windows. Note that for DeepAR, the normalized column represents model trainedwith scaler=True and unnormalized represents scaler=False. Prophet could not be scaled to the wiki dataset, eventhough it was parallelized on a 32 core machine. Below the main table, we provide MAE/MAPE/RMSE comparisonwith the models implemented in [29], on the PeMSD7(M) dataset.

Algorithm electricity n = 370 traffic n = 963 wiki n = 115, 084Normalized Unnormalized Normalized Unnormalized Normalized Unnormalized

ProposedDeepGLO 0.133/0.453/0.162 0.082/0.341/0.121 0.166/ 0.210 /0.179 0.148/0.168/0.142 0.569/3.335/1.036 0.237/0.441/0.395

Local TCN (LeveledInit) 0.143/0.356/0.207 0.092/0.237/0.126 0.157/0.201/0.156 0.169/0.177/0.169 0.243/0.545/0.431 0.212/0.316/0.296Global TCN-MF 0.144/0.485/0.174 0.106/0.525/0.188 0.336/0.415/0.451 0.226/0.284/0.247 1.19/8.46/1.56 0.433/1.59/0.686

Local-Only

LSTM 0.109/0.264/0.154 0.896/0.672/0.768 0.276/0.389/0.361 0.270/0.357/0.263 0.427/2.170/0.590 0.789/0.686/0.493DeepAR 0.086/0.259/ 0.141 0.994/0.818/1.85 0.140/0.201/ 0.114 0.211/0.331/0.267 0.429/2.980/0.424 0.993/8.120/1.475

TCN (no LeveledInit). 0.147/0.476/0.156 0.423/0.769/0.523 0.204/0.284/0.236 0.239/0.425/0.281 0.336/1.322/0.497 0.511/0.884/0.509Prophet 0.197/0.393/0.221 0.221/0.586/0.524 0.313/0.600/0.420 0.303/0.559/0.403 - -

Global-Only TRMF (retrained) 0.104/0.280/0.151 0.105/0.431/0.183 0.159/0.226/ 0.181 0.210/ 0.322/ 0.275 0.309/0.847/0.451 0.320/0.938/0.503SVD+TCN 0.219/0.437/0.238 0.368/0.779/0.346 0.468/0.841/0.580 0.329/0.687/0.340 0.697/3.51/0.886 0.639/2.000/0.893

Algorithm PeMSD7(M) (MAE/MAPE/RMSE)DeepGLO (Unnormalized) 3.53/ 0.079 / 6.49DeepGLO (Normalized) 4.53/ 0.103 / 6.91

STGCN(Cheb) 3.57/0.087/6.77STGCN(1st) 3.79/0.091/7.03

6 Empirical Results

In this section, we validate our model on four real-world data-sets on rolling prediction tasks (see Section C.1for more details) against other benchmarks. The data-sets in consideration are, (i) electricity [23] - Hourly loadon 370 houses. The training set consists of 25, 968 time-points and the task is to perform rolling validationfor the next 7 days (24 time-points at a time, for 7 windows) as done in [29, 20, 9];(ii) traffic [7] - Hourlytraffic on 963 roads in San Francisco. The training set consists of 10m392 time-points and the task is toperform rolling validation for the next 7 days (24 time-points at a time, for 7 windows) as done in [29, 20, 9]and (iii) wiki [14] - Daily web-traffic on about 115, 084 articles from Wikipedia. We only keep the time-serieswithout missing values from the original data-set. The values for each day are normalized by the total trafficon that day across all time-series and then multiplied by 1e8. The training set consists of 747 time-pointsand the task is to perform rolling validation for the next 86 days, 14 days at a time. More data statisticsindicating scale variations are provided in Table 1. (iv) PeMSD7(M) [6] - Data collected from Caltrain PeMSsystem, which contains data for 228 time-series, collected at 5 min interval. The training set consists of 11232time-points and we perform rolling validation for the next 1440 points, 9 points at a time.

For each data-set, all models are compared on two different settings. In the first setting the models aretrained on normalized version of the data-set where each time series in the training set is re-scaled asy

(i)1:t−τ = (y

(i)1:t−τ − µ(y

(i)1:t−τ ))/(σ(y

(i)1:t−τ )) and then the predictions are scaled back to the original scaling. In

the second setting, the data-set is unnormalized i.e left as it is while training and prediction. Note that allmodels are compared in the test range on the original scale of the data. The purpose of these two settings isto measure the impact of scaling on the accuracy of the different models.The models under contention are: (1) DeepGLO: The combined local and global model proposed in Section 5.2.We use time-features like time-of-day, day-of-week etc. as global covariates, similar to DeepAR. For a moredetailed discussion, please refer to Section C.3. (2) Local TCN (LeveledInit): The temporal convolution basedarchitecture discussed in Section 4, with LeveledInit. (3) LSTM: A simple LSTM block that predicts thetime-series values as function of the hidden states [11]. (4) DeepAR: The model proposed in [9]. (5) TCN: Asimple Temporal Convolution model as described in Section 4. (6) Prophet: The versatile forecasting modelfrom Facebook based on classical techniques [8]. (7) TRMF: the model proposed in [29]. Note that thismodel needs to be retrained for every rolling prediction window. (8) SVD+TCN: Combination of SVD andTCN. The original data is factorized as Y = UV using SVD and a leveled network is trained on the V. Thisis a simple baseline for a global-only approach. (9) STGCN: The spatio-temporal models in [28]. We use thesame hyper-parameters for DeepAR on the traffic and electricity datasets, as specified in [9], as implementedin GluonTS [1]. The WAPE values from the original paper could not be directly used, as there are different

8

Page 9: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

values reported in [9] and [20]. Note that for DeepAR, normalized and unnormalized settings correspondsto using sclaing=True and scaling=False in the GluonTS package. The model in TRMF [29] was trainedwith different hyper-parameters (larger rank) than in the original paper and therefore the results are slightlybetter. More details about all the hyper-parameters used are provided in Section C. The rank k used inelectricity, traffic, wiki and PeMSD7(M) are 64/60, 64/60, 256/1, 024 and 64/− for DeepGLO/TRMF.In Table 2, we report WAPE/MAPE/SMAPE (see definitions in Section C.2) on the first three datasetsunder both normalized and unnormalized training. We can see that DeepGLO features among the top twomodels in almost all categories, under all three metrics. DeepGLO does better than the individual localTCN (LeveledInit) method and the global TCN-MF model on average, as it is aided by both global andlocal factors. The local TCN (LeveledInit) model performs the best on the larger wiki dataset with > 30%improvement over all models (not proposed in this paper) in terms of WAPE, while DeepGLO is close behindwith greater than 25% improvement over all other models. We also find that DeepGLO performs betterin the unnormalized setting on all instances, because there is no need for scaling the input and rescalingback the outputs of the model. We find that the TCN (no LeveledInit), DeepAR1 and the LSTM models donot perform well in the unnormalized setting as expected. In the second table, we compare DeepGLO withthe models in [28], which can capture global features but require a weighted graph representing closenessrelations between the time-series as external input. We see that DeepGLO (unnormalized) performs the beston all metrics, even though it does not require any external input. Our implementation can be found athttps://github.com/rajatsen91/deepglo.

References

[1] A. Alexandrov, K. Benidis, M. Bohlke-Schneider, V. Flunkert, J. Gasthaus, T. Januschowski, D. C.Maddix, S. Rangapuram, D. Salinas, J. Schulz, L. Stella, A. C. Türkmen, and Y. Wang. GluonTS:Probabilistic Time Series Modeling in Python. arXiv preprint arXiv:1906.05264, 2019.

[2] Shaojie Bai, J Zico Kolter, and Vladlen Koltun. An empirical evaluation of generic convolutional andrecurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271, 2018.

[3] Anastasia Borovykh, Sander Bohte, and Cornelis W Oosterlee. Conditional time series forecasting withconvolutional neural networks. arXiv preprint arXiv:1703.04691, 2017.

[4] George EP Box and Gwilym M Jenkins. Some recent advances in forecasting and control. Journal of theRoyal Statistical Society. Series C (Applied Statistics), 17(2):91–109, 1968.

[5] Chris Chatfield. Time-series forecasting. Chapman and Hall/CRC, 2000.

[6] Chao Chen, Karl Petty, Alexander Skabardonis, Pravin Varaiya, and Zhanfeng Jia. Freeway performancemeasurement system: mining loop detector data. Transportation Research Record, 1748(1):96–102, 2001.

[7] Marco Cuturi. Fast global alignment kernels. In Proceedings of the 28th international conference onmachine learning (ICML-11), pages 929–936, 2011.

[8] Facebook. Fbprophet. https://research.fb.com/prophet-forecasting-at-scale/, 2017. [Online;accessed 07-Jan-2019].

[9] Valentin Flunkert, David Salinas, and Jan Gasthaus. Deepar: Probabilistic forecasting with autoregressiverecurrent networks. arXiv preprint arXiv:1704.04110, 2017.

[10] Ken-ichi Funahashi and Yuichi Nakamura. Approximation of dynamical systems by continuous timerecurrent neural networks. Neural networks, 6(6):801–806, 1993.

[11] Felix A Gers, Jürgen Schmidhuber, and Fred Cummins. Learning to forget: Continual prediction withlstm. 1999.

[12] James Douglas Hamilton. Time series analysis, volume 2. Princeton university press Princeton, NJ,1994.

1Note that for DeepAR, normalized means the GluonTS implementation run with scaler=True and unnormalized meansscaler=False

9

Page 10: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

[13] Rob Hyndman, Anne B Koehler, J Keith Ord, and Ralph D Snyder. Forecasting with exponentialsmoothing: the state space approach. Springer Science & Business Media, 2008.

[14] Kaggle. Wikipedia web traffic. https://www.kaggle.com/c/web-traffic-time-series-forecasting/data,2017. [Online; accessed 07-Jan-2019].

[15] Kyoung-jae Kim. Financial time series forecasting using support vector machines. Neurocomputing,55(1-2):307–319, 2003.

[16] Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long-and short-term temporalpatterns with deep neural networks. In The 41st International ACM SIGIR Conference on Research &Development in Information Retrieval, pages 95–104. ACM, 2018.

[17] Paul D Larson. Designing and managing the supply chain: Concepts, strategies, and case studies, davidsimchi-levi philip kaminsky edith simchi-levi. Journal of Business Logistics, 22(1):259–261, 2001.

[18] Helmut Lütkepohl. New introduction to multiple time series analysis. Springer Science & BusinessMedia, 2005.

[19] ED McKenzie. General exponential smoothing and the equivalent arma process. Journal of Forecasting,3(3):333–344, 1984.

[20] Syama Sundar Rangapuram, Matthias W Seeger, Jan Gasthaus, Lorenzo Stella, Yuyang Wang, and TimJanuschowski. Deep state space models for time series forecasting. In Advances in Neural InformationProcessing Systems, pages 7796–7805, 2018.

[21] Matthias W Seeger, David Salinas, and Valentin Flunkert. Bayesian intermittent demand forecasting forlarge inventories. In Advances in Neural Information Processing Systems, pages 4646–4654, 2016.

[22] Martin Sundermeyer, Ralf Schlüter, and Hermann Ney. Lstm neural networks for language modeling. InThirteenth annual conference of the international speech communication association, 2012.

[23] Artur Trindade. Electricityloaddiagrams20112014 data set. https://archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams20112014,2011. [Online; accessed 07-Jan-2019].

[24] Aäron Van Den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, NalKalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio.CoRR abs/1609.03499, 2016.

[25] Yuyang Wang, Alex Smola, Danielle Maddix, Jan Gasthaus, Dean Foster, and Tim Januschowski. Deepfactors for forecasting. In International Conference on Machine Learning, pages 6607–6617, 2019.

[26] Ruofeng Wen, Kari Torkkola, Balakrishnan Narayanaswamy, and Dhruv Madeka. A multi-horizonquantile recurrent forecaster. arXiv preprint arXiv:1711.11053, 2017.

[27] Kevin W Wilson, Bhiksha Raj, and Paris Smaragdis. Regularized non-negative matrix factorization withtemporal dependencies for speech denoising. In Ninth Annual Conference of the International SpeechCommunication Association, 2008.

[28] Bing Yu, Haoteng Yin, and Zhanxing Zhu. Spatio-temporal graph convolutional networks: A deeplearning framework for traffic forecasting. arXiv preprint arXiv:1709.04875, 2017.

[29] Hsiang-Fu Yu, Nikhil Rao, and Inderjit S Dhillon. Temporal regularized matrix factorization for high-dimensional time series prediction. In Advances in neural information processing systems, pages 847–855,2016.

10

Page 11: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

w

yj�l:j�1

rj

mj

Figure 3: Illustration of DLN

A Deep Leveled Network

Large scale time-series datasets containing upwards of hundreds of thousands of time-series can have verydiverse scales. The diversity in scale leads to issues in training deep models, both Temporal Convolutionsand LSTM based architectures, and some normalization is needed for training to succeed [16, 3, 9]. However,selecting the correct normalizing factor for each time-series is not an exact science and can have effects onpredictive performance. For instance in [9] the data-sets are whitened using the training standard deviationand mean of each time-series while training, and the predictions are renormalized. On the other handin [3], each time-series is rescaled by the value of that time-series on the first time-step. Moreover, whenperforming rolling predictions using a pre-trained model, when new data is observed there is a potential needfor updating the scaling factors by incorporating the new time-points. In this section we propose DLN , asimple leveling network architecture that can be trained on diverse datasets without the need for a priorinormalization.

DLN consists of two temporal convolution blocks (having the same dynamic range/look-back l) that aretrained concurrently. Let us denote the two networks and the associated weights by Tm(·|Θm) and Tr(·|Θr)respectively. The key idea is to have Tm(·|Θm) (the leveling component) to predict the rolling mean of thenext w future time-points given the past. On the other-hand Tr(·|Θr) (the residual component) will be usedto predict the variations with respect to this mean value. Given an appropriate window size w the rollingmean stays stable for each time-series and can be predicted by a simple temporal convolution model andgiven these predictions the additive variations are relatively scale free i.e. the network Tr(·|Θr) can be trainedreliably without normalization. This can be summarized by the following equations:

[yj−l+1, · · · , yj ] = TDLN (yj−l:j−1|Θm,Θr) := Tm (yj−l:j−1|Θm)+Tr(yj−l:j−1|Θr) (4)[mj−l+1, · · · , mj ] = Tm(yj−l:j−1|Θm) (5)

[rj−l+1, · · · , rj ] = Tr(yj−l:j−1|Θr) (6)

where we want mj to be close to µ(yj:j+w−1) and rj to be close to yj − µ(yj:j+w−1). An illustration of theleveled network methodology is shown in the above figure.

Training: Both the networks can be trained concurrently given the training set Y(tr), using mini-batchstochastic gradient updates. The pseudo-code for training a DLN is described in Algorithm 1. The lossfunction L(·, ·) used is the same as the metric defined in Eq. (1). Note that in Step 9, the leveling componentTm(·|Θm) is held fixed and only Tr(·|Θr) is updated.

Prediction: The trained model can be used for multi-step look-ahead prediction in a standard manner.Given the past data-points of a time-series, yj−l:j−1, the prediction for the next time-step is given by yjdefined in (4). Now, the one-step look-ahead prediction can be concatenated with the past values to formthe sequence yj−l+1:j = [yj−l+1:j−1yj ], which can be again passed through the network and get the nextprediction: [· · · , yj+1] = TDLN(yj−l+1:j). The same procedure can be repeated τ times to predict τ time-stepsahead in the future. Table 3 shows the performance of leveled network on the same datasets and merticsused in Table 2.

11

Page 12: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

Table 3: Performance of DLN on the same datasets and metrics as in Table 2.

Algorithm electricity n = 370 traffic n = 963 wiki n = 115, 084Normalized Unnormalized Normalized Unnormalized Normalized Unnormalized

Proposed Local DLN 0.086/0.258/0.129 0.118/ 0.336/0.172 0.169/0.246/0.218 0.237/0.422/0.275 0.235/0.469/ 0.346 0.288/0.397/0.341

We will now provide a proof of Proposition 1.

Proof of Proposition 1. We will follow the convention of numbering the input layer as layer 0 and eachsubsequent layers in increasing order. 1a shows a TCN with the last layered numbered d = 4. Each neuronin a layer is numbered starting at 0 from the right-hand side. ai,j denote neuron j in layer i. We will focuson the neurons in each layer that take part in the prediction yj . Note that on layer d − 1 (d being thelast layer), the neurons that are connected to the output yj , are ad−1,0 and ad−1,2d−1 . Therefore, we haveyj = 1

2 (ad−1,0 + ad−1,2d−1), whenever the neurons have values greater equal to zero. Similary, any neuronal,s∗2l is the average of al−1,s∗2l and al−1,(2s+1)∗2l−1 . Therefore, by induction we have that,

yj =1

2 ∗ 2d−1

2∗2d−1∑i=1

yj−i. (7)

B Rolling Prediction without Retraining

Once the TCN-MF model is trained using Algorithm 2, we can make predictions on the test range usingmulti-step look-ahead prediction. The method is straight-forward - we first use TX(·) to make multi-steplook-ahead prediction on the basis time-series in X(tr) as detailed in Section 4, to obtained X(te); then theoriginal time-series predictions can be obtained by Y(te) = FX(te). This model can also be adapted to makerolling predictions without retraining. In the case of rolling predictions, the task is to train the model on atraining period say Y[:, 1 : t1], then make predictions on a future time period say Y[:, t1 + 1 : t2], then receivethe actual values on the future time-range Y[:, t1 + 1 : t2] and after incorporating these values make furtherpredictions for a time range further in the future Y[:, t2 + 1 : t3] and so on. The key challenge in this scenario,is to incorporate the newly observed values Y[:, t1 + 1 : t2] to generate the values of the basis time-series inthat period which is X[:, t1 + 1 : t2]. We propose to obtain these values by minimizing global loss defined in(3) while keeping F and TX(·) fixed:

X[:, t1 + 1 : t2] = argminM∈Rk×(t2−t1)

LG (Y[:, t1 + 1 : t2],F,M, TX) .

Once we obtain X[:, t1 + 1 : t2], we can make predictions in the next set of future time-periods Y[:, t2 + 1 : t3].Note that the TRMF model in [29] needed to be retrained from scratch to incorporate the newly observedvalues. In this work retraining is not required to achieve good performance, as we shall see in our experimentsin Section 6.

C More Experimental Details

We will provide more details about the experiments like the exact rolling prediction setting in each data-sets,the evaluation metrics and the model hyper-parameters.

C.1 Rolling Prediction

In our experiments in Section 6, we compare model performances on rolling prediction tasks. The goal inthis setting is to predict future time-steps in batches as more data is revealed. Suppose the initial trainingtime-period is {1, 2, ..., t0}, rolling window size τ and number of test windows nw. Let ti = t0 + iτ . The rollingprediction task is a sequential process, where given data till last window, Y[:, 1 : ti−1], we predict the values

12

Page 13: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

for the next future window Y[:, ti−1 + 1 : ti], and then the actual values for the next window Y[:, ti−1 + 1 : ti]are revealed and the process is carried on for i = 1, 2, ..., nw. The final measure of performance is the lossL(Y[:, t0 + 1 : tnw

],Y[:, t0 + 1 : tnw]) for the metric L defined in Eq. (1).

For instance, In the traffic data-set experiments we have t0 = 10392, τ = 24, w = 7 and in electricityt0 = 25968, τ = 24, w = 7. The wiki data-set experiments have the parameters t0 = 747, τ = 14, w = 4.

C.2 Loss Metrics

The following well-known loss metrics [13] are used in this paper. Here, Y ∈ Rn′×t′ represents the actualvalues while Y ∈ Rn′×t′ are the corresponding predictions.

(i) WAPE: Weighted Absolute Percent Error is defined as follows,

L(Y,Y) =

∑n′

i=1

∑t′

j=1 |Yij − Yij |∑n′

i=1

∑t′

j=1 |Yij |. (8)

(ii) MAPE: Mean Absolute Percent Error is defined as follows,

Lm(Y,Y) =1

Z0

n′∑i=1

t′∑j=1

|Yij − Yij ||Yij |

1{|Yij | > 0}, (9)

where Z0 =∑n′

i=1

∑t′

j=1 1{|Yij | > 0}.(iii) SMAPE: Symmetric Mean Absolute Percent Error is defined as follows,

Ls(Y,Y) =1

Z0

n′∑i=1

t′∑j=1

2|Yij − Yij ||Yij + Yij |

1{|Yij | > 0}, (10)

where Z0 =∑n′

i=1

∑t′

j=1 1{|Yij | > 0}.

C.3 Model Parameters and Settings

In this section we will describe the compared models in more details. For a TC network the importantparameters are the kernel size/filter size, number of layers and number of filters/channels per layer. Anetwork described by [c1, c2, c3] implies that there are three layers with ci filters in layer i. For, an LSTM theparameters (nh, nl) means that the number of neurons in hidden layers is nh, and number of hidden layers isnl. All models are trained with early stopping with a tenacity or patience of 7, with a maximum number ofepochs 300. The hyper-parameters for all the models are as follows,

DeepGLO: In all the datasets, except wiki and PeMSD7(M) the networks TX and TY both have param-eters [32, 32, 32, 32, 32, 1] and kernel size is 7. On the wiki dataset, we set the networks TX and TY withparameters [32, 32, 32, 32, 1]. On the PeMSD7(M) dataset we set the parameters as [32, 32, 32, 32, 32, 1] and[16, 16, 16, 16, 16, 1]. We set α and λT both to 0.2 in all experiments. The rank k used in electricity, traffic,wiki and PeMSD7(M) are 64, 64 ,256 and 64 respectively. We use 7 time-covariates, which includes minute ofthe hour, hour of the day, day of the week, day of the month, day of the year, month of the year, week of theyear, all normalized in a range [−0.5, 0.5], which is a subset of the time-covariates used by default in theGluonTS library.

Local TCN (LeveledInit): We use the setting [32, 32, 32, 32, 32, 1] for all datasets.

Local DLN: In all the datasets, the leveled networks have parameters [32, 32, 32, 32, 32, 1] and kernel size is7.

TRMF: The rank k used in electricity, traffic, wiki are 60, 60 ,1024 respectively. The lag indices are set toinclude the last day and the same day in the last week for traffic and electricity data.

13

Page 14: arXiv:1905.03806v2 [stat.ML] 27 Oct 2019 · Think Globally, Act Locally: A Deep Neural Network Approach to High-Dimensional Time Series Forecasting Rajat Sen 1, Hsiang-Fu Yu , and

SVD+Leveled: The rank k used in electricity, traffic and wiki are 60, 60 and 500 respectively. In all thedatasets, the leveled networks have parameters [32, 32, 32, 32, 32, 1] and kernel size is 7.

LSTM: In all datasets the parameters are (45, 3).

DeepAR: In all datasets, we use the default parameters in the DeepAREstimator in the GluonTS imple-mentation.

TCN: In all the datasets, the parameters are [32, 32, 32, 32, 32, 1] and kernel size is 7.

Prophet: The parameters are selected automatically. The model is parallelized over 32 cores. The modelwas run with growth = ’logistic’, as this was found to perform the best.

Note that we replicate the exact values reported in [28] for the STGCN models on the PeMSD7(M)dataset.

14