I think I've figured out the use of "filter" in the ts package, at least for a simple AR model. I simulated a simple AR time series, modeled it using "arima", and then used "filter" to compute the 1-step ahead forecasts:

> y.arma <- arima.sim(list(ar=0.8),n=200)
> y.arma.arima <- arima(y.arma,order=c(1,0,0),include.mean=FALSE)
> y.arma.arima

Call:
arima(x = y.arma, order = c(1, 0, 0), include.mean = FALSE)

Coefficients:
        ar1
     0.7594
s.e.  0.0455

sigma^2 estimated as 1.059: log likelihood = -290, aic = 583.99

> plot(y.arma[-1],lines="l")
> lines(filter(y.arma,y.arma.arima$coef,method="con")[-200],lty=2)

So using the "convolution" method appears to produce the correct forecast for the y.arma series.

But suppose I had generated and fitted an ARMA(1,1) or ARIMA(1,1,1) model? How would I use "filter" in this case?

Rick B.

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to