Skip to content

filtering ts with arima

3 messages · Samak, Vele [EQRE], Brian Ripley, Spencer Graves

#
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,
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
#
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:

            

  
    
#
Did you try library(ts)?

Spencer Graves
Samak, Vele [EQRE] wrote: