[R] Transfer Function Modeling

Martin Maechler maechler at stat.math.ethz.ch
Thu Mar 6 09:49:36 CET 2003

>>>>> "Richard" == Richard A Bilonick <rab at nauticom.net>
>>>>>     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?


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 r-help at r-project.org [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 <maechler at stat.math.ethz.ch>	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			<><

More information about the R-help mailing list