[R] unstable MA results in ARIMA?

Nuno Prista nmprista at fc.ul.pt
Fri Oct 24 17:45:31 CEST 2008


Dear colleagues,

I am relatively new to R and time series and so I am experiencing 
difficulties in interpreting the output of "arima" in MA models (but not 
in AR models). I cannot make sense of the 1st innovations returned by 
"arima".

In an AR(1) model I expect data[t]=phi1*data[t-1]+a[t] and in a MA(1) 
model data[t]=a[t]+theta1*a[t-1]. My interpretation from R-help is that 
a[t] estimates are given by model$res. 

In AR models when I do

data.sim<-arima.sim(n = 60, list(ar =0.68 ),sd = sqrt(0.6))
data.fit<-arima(data.sim, order=c(1,0,0), xreg=NULL, include.mean=FALSE, 
transform.pars=TRUE, fixed=NULL, init=NULL, method="ML")
z<-rep(NA,60)
for (t in 2:60){
z[t]<-data.fit$coef*data.sim[t-1]+data.fit$res[t]
}
plot(data.sim-z, type="o", pch=19)

I see that the arima was well fitted and that all a[t] are well calculated

However, in the MA case I have experienced problems with the first set 
of residuals,

data.sim<-arima.sim(n = 60, list(ma =0.68 ),sd = sqrt(0.6))
data.fit<-arima(data.sim, order=c(0,0,1), xreg=NULL, include.mean=FALSE, 
transform.pars=TRUE, fixed=NULL, init=NULL, method="ML")
z<-rep(NA,60)
for (t in 2:60){z[t]<-data.fit$res[t]+data.fit$coef*data.fit$res[t-1]}
windows(); plot(data.sim-z, type="o", pch=19)

It seems to me that the 1st and (sometimes the 2nd) innovations are not 
correct and that a[t] are correct only for larger t. However, the value 
of sigma2 returned seems to be based on all a[t]. I made a fe more tests 
and the number of residuals which appear (to me) miss-calculated gets 
larger and larger when I test q>1. Can I trust the "arima" estimates in 
the MA case as I do in the AR case?

Thanks,

Nuno Prista
_________________________
CO - FCUL, Lisboa, Portugal
CQFE - ODU, Norfolk, USA



More information about the R-help mailing list