Usage
nnetar(y, p, P=1, size, repeats=20, xreg=NULL, lambda=NULL, model=NULL, subset=NULL, scale.inputs=TRUE, x=y, ...)
Arguments
y
A numeric vector or time series.
p
Embedding dimension for non-seasonal time series. Number of non-seasonal lags used as inputs. For non-seasonal time series, the default is the optimal number of lags (according to the AIC) for a linear AR(p) model. For seasonal time series, the same method is used but applied to seasonally adjusted data (from an stl decomposition).
P
Number of seasonal lags used as inputs.
size
Number of nodes in the hidden layer. Default is half of the number of input nodes (including external regressors, if given) plus 1.
repeats
Number of networks to fit with different random starting weights. These are then averaged when producing forecasts.
xreg
Optionally, a vector or matrix of external regressors, which must have the same number of rows as y
. Must be numeric.
lambda
Box-Cox transformation parameter.
model
Output from a previous call to nnetar
. If model is passed, this same model is fitted to y
without re-estimating any parameters.
subset
Optional vector specifying a subset of observations to be used in the fit. Can be an integer index vector or a logical vector the same length as y
. All observations are used by default.
scale.inputs
If TRUE, inputs are scaled by subtracting the column means and dividing by their respective standard deviations. If lambda
is not NULL
, scaling is applied after Box-Cox transformation.
x
Deprecated. Included for backwards compatibility.
...
Other arguments passed to nnet
for nnetar
.