[R] filtering ts with arima

Prof Brian D Ripley ripley at stats.ox.ac.uk
Wed Apr 9 16:56:00 CEST 2003


I know that there is no direct equivalent to arima.filt in R.  I also know
that your R calls are *not* equivalent to the S-PLUS ones.

I would use S-PLUS to run S-PLUS code: you are a commercial operation and
should be able to afford it, Or you could employ an S programmer to convert
the code for you.

As `_' is strongly deprecated in both S-PLUS and R, it should to be used in
postings.

On Wed, 9 Apr 2003, Samak, Vele [EQRE] wrote:

> Anyone know how to do this? Thanks,
>
> -----Original Message-----
> From: Samak, Vele [EQRE]
> Sent: Monday, April 07, 2003 11:30 AM
> To: 'r-help at stat.math.ethz.ch'
> Subject: [R] filtering ts with arima
>
>
> Hi,
>
> I have the following code from Splus that I'd like to migrate to R. So far,
> the only problem is the arima.filt function. This function allows me to
> filter an existing time-series through a previously estimated arima model,
> and obtain the residuals for further use. Here's the Splus code:
>
> # x is the estimation time series, new.infl is a timeseries that contains
> new information
> # a.mle is estimated result (list) from arima.mle, (1,0,1) x (1,0,1)12
> seasonal model
> mdl 	_ list(list(order=c(1,0,1)), list(order=c(1,0,1), period=12))
> a.mle	_ arima.mle(x, model = mdl)
>
> # then, we get regular residuals:
> new.pred        _ arima.filt(new.infl, a.mle$model)$pred
> new.res         _ new.infl - new.pred
>
> The R code from library(ts) would be:
>
> # new.infl is a timeseries
> # a.mle is estimated result (list) from arima.mle, (1,0,1) x (1,0,1)12
> seasonal model
> a2.mle _ arima(x, order=c(1,0,1), seasonal=list(order=c(1,0,1), period=12),
> include.mean=F, method="ML")
>
> new.infl ????
> new.res         _ new.infl - new.pred
>
> What's the arima.filt equivalent in R: filter doesn't seem to take the
> coefficients for a seasonal model correctly, also predict isn't quite the
> answer? Help is appreciated. Thanks,
>
>
> > Vele Samak
> > Vice President
> > Global Quantitative Research Group
> > CITIGROUP / Smith Barney
> > 388 Greenwich St. 29th Floor
> > New York, NY 10013
> > (212) 816-0379
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list