laggedData {sisal} | R Documentation |
Create Input Matrix and Output Vector for Time Series Prediction
Description
Given a time series vector, produces the input matrix and output vector for a time series prediction task. The other parameters are the lags to include and the number of steps ahead to predict.
Usage
laggedData(x, lags = 0:9, stepsAhead = 1)
Arguments
x |
an |
lags |
which lags to use for prediction. A |
stepsAhead |
how many steps ahead to predict. A non-negative
integral value ( |
Details
The default parameters correspond to predicting one step ahead
(position t+1
) using the ten most recent values
(positions t
... t-9
).
Value
A list
with two components:
X |
The |
y |
The output |
Author(s)
Mikko Korpela
Examples
laggedData(1:20)