NNsetting function

Setting Up The Predictor Matrix in A Neural Network for Time Series Data

Setting Up The Predictor Matrix in A Neural Network for Time Series Data

The function sets up the predictor matrix in a neural network for time series data.

NNsetting(zt, locY = 1, nfore = 0, lags = c(1:5), include.lagY = TRUE)

Arguments

  • zt: data matrix, including the dependent variable Y(t).
  • locY: location of the dependent variable (column number).
  • nfore: number of out-of-sample prediction (1-step ahead).
  • lags: a vector containing the lagged variables used to form the x-matrix.
  • include.lagY: indicator for including lagged Y(t) in the predictor matrix.

Returns

The function returns a list with following components. - X: x-matrix for training a neural network.

  • y: y-output for training a neural network.

  • predX: x-matrix for the prediction subsample.

  • predY: y-output for the prediction subsample.

References

Tsay, R. and Chen, R. (2018). Nonlinear Time Series Analysis. John Wiley & Sons, New Jersey.

  • Maintainer: Xialu Liu
  • License: GPL (>= 2)
  • Last published: 2023-09-24

Useful links