[R] filtering ts with arima

Samak, Vele [EQRE] vele.samak at citigroup.com
Mon Apr 7 17:30:19 CEST 2003


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



More information about the R-help mailing list