>>>>> "Richard" == Richard A Bilonick <[EMAIL PROTECTED]>
>>>>> on Wed, 05 Mar 2003 12:01:01 -0500 writes:
Richard> I think I've figured out the use of "filter" in the ts package, at least
Richard> for a simple AR model. I simulated a simple AR time series, modeled it
Richard> using "arima", and then used "filter" to compute the 1-step ahead
Richard> 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
Richard> Call:
Richard> arima(x = y.arma, order = c(1, 0, 0), include.mean = FALSE)
Richard> Coefficients:
Richard> ar1
Richard> 0.7594
Richard> s.e. 0.0455
Richard> 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)
Richard> So using the "convolution" method appears to produce the correct
Richard> forecast for the y.arma series.
Richard> But suppose I had generated and fitted an ARMA(1,1) or ARIMA(1,1,1)
Richard> model? How would I use "filter" in this case?
help(predict.Arima)
describes the predict() method for objects of class "Arima"
which is what you get from res <- arima(.....)
I'd use that in any case instead of filter().
PS: Please guys, stop doing the following:
1. You want to post something to R-help.
2. You are too lazy to type [EMAIL PROTECTED] [the
shortest of several possible addresses]
3. you reply to another __unrelated__ posting to R-help instead.
==> all threads are mixed up !
-- both on the mailing list archives, and on anyone's e-mail
list who uses threaded e-mail presentation (e.g. me.)
Martin Maechler <[EMAIL PROTECTED]> http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27
ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND
phone: x-41-1-632-3408 fax: ...-1228 <><
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help