Usage
nnetar(x, p, P=1, size, repeats=20, xreg=NULL, lambda=NULL, model=NULL,
scale.inputs=TRUE, ...)
## S3 method for class 'nnetar':
forecast(object, h=ifelse(object$m > 1, 2 * object$m, 10),
xreg=NULL, lambda=object$lambda, ...)
Arguments
x
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 metho
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 x. 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 x
without re-estimating any parameters.
scale.inputs
If TRUE, inputs are scaled by subtracting the column means and dividing by their respective standard deviations.
object
An object of class nnetar
generated by nnetar
. h
Number of periods for forecasting.
...
Other arguments passed to nnet
for nnetar
but ignored for forecast.nnetar
.