# Time Series

### Extract Data as Univariate Time Series¶

 1 extractTimeSeries(Tfunc) 
• Type: DataPipe[Stream[String], Stream[(Double, Double)]]
• Result: This pipe assumes its input to be of the form YYYY,Day,Hour,Value. It takes as input a function (TFunc) which converts a (Double, Double, Double) into a single timestamp like value. The pipe processes its data source line by line and outputs a Tuple2 in the following format (Timestamp,Value).

### Extract data as Multivariate Time Series¶

 1 extractTimeSeriesVec(Tfunc) 
• Type: DataPipe[Stream[String], Stream[(Double, DenseVector[Double])]]
• Result: This pipe is similar to extractTimeSeries but for application in multivariate time series analysis such as nonlinear autoregressive models with exogenous inputs. The pipe processes its data source line by line and outputs a (Double, DenseVector[Double]) in the following format (Timestamp,Values).

### Construct Time differenced Data¶

 1 deltaOperation(deltaT, timelag) 
• Type: DataPipe[Stream[(Double, Double)], Stream[(DenseVector[Double], Double)]]
• Result: In order to generate features for auto-regressive models, one needs to construct sliding windows in time. This function takes two parameters deltaT: the auto-regressive order and timelag: the time lag after which the windowing is conducted. E.g Let deltaT = 2 and timelag = 1 This pipe will take stream data of the form $(t, y(t))$ and output a stream which looks like $(t, [y(t-2), y(t-3)])$

### Construct multivariate Time differenced Data¶

 1 deltaOperationVec(deltaT: Int) 
• Type: DataPipe[Stream[(Double, Double)], Stream[(DenseVector[Double], Double)]]
• Result: A variant of deltaOperation for NARX models.

### Haar Discrete Wavelet Transform¶

 1 haarWaveletFilter(order: Int) 
• Type: DataPipe[DenseVector[Double], DenseVector[Double]]
• Result: A Haar Discrete wavelet transform.