arima.forecast(x, model, n, end, sigma2=<<see below>>, future.positions = NULL, ...)
ts
,
rts
) or a new-style time series (class
"timeSeries"
).
Missing values (NA) are allowed.
arima.mle
.
Note that the coefficients must be provided through the elements
ar
and
ma
(otherwise the coefficients are set to zero).
end
or
n
must be specified.
If both are specified, they must agree.
end
is provided).
end(x)
and
end
.
sigma2
will be the
concentrated prediction error variance computed from the model.
tsmatrix(mean-1.96*std.err, mean+1.96*std.err)
is a 95% (non-simultaneous) confidence interval for the forecast
in that time period.
Note that
std.err
does not take into account the variability
due to estimation of the ARIMA model.
The ARIMA model is put into state space form and the Kalman
filter is applied to obtain the forecast intervals.
This is done using the function
arima.filt
.
This function is superseded by ARIMA model object method function
predict.arima
.
Harvey, A. C. (1981). Time Series Models. Wiley, New York.
# Fit an ARIMA model to the ship data and forecast one year beyond the end of # the data. Plot the series along with forecast means +/- two standard errors model <- list(list(order=c(0,1,1)),list(order=c(0,1,1),period=12)) ship.fit <- arima.mle(ship,model=model) ship.fore <- arima.forecast(ship,n=12,model=ship.fit$model) tsplot(ship,ship.fore$mean,ship.fore$mean+2*ship.fore$std.err, ship.fore$mean-2*ship.fore$std.err)