arima.diag
,
arima.forecast
, and method function
predict.arima
.
arima.filt(x, model, n.cond=<<see below>>, xreg=NULL, reg.coef=NULL)
NA
s) are allowed.
arima.mle
.
Note that the coefficients must be provided through the elements
ar
and
ma
(otherwise the coefficients are set to zero).
n.cond
must be at least P+D (the default), where P and D are
the orders of the expanded autoregressive and differencing polynomials.
xreg
.
loglik
plus 2 times the number of parameters fit.
filt
is the same as
x
.
var.filt
is
0
except possibly at
the beginning where there may be
NA
s.
The ARIMA model is put into state space form and the Kalman filter
is applied to obtain the predicted and filtered values.
No predicted or filtered values are produced for the first P+D
observations, where P and D are the orders of the
expanded autoregressive and differencing polynomials.
In particular, the state space form implies that the filtering is more
complex than might be expected.
For example in an MA(1) model, the predicted value is not merely the
moving average coefficient times the last residual, see
Harvey (1981, page 112).
Harvey, A. C. (1981).
Time Series Models.
Wiley, New York.
The chapter "Analyzing Time Series" of the S-PLUS Guide to Statistical and Mathematical Analysis.
# Append missing values to the end of the ship data and # use arima.filt to produce forecast values. # Note: this could be done more directly using arima.forecast. model <- list(list(order=c(0,1,1)),list(order=c(0,1,1),period=12)) fit <- arima.mle(ship,model=model) ship.fore <- ts(c(ship,rep(NA,12)),start=start(ship),frequency=frequency(ship)) forecast <- arima.filt(ship.fore,model=fit$model)$pred