[R] How to remove autocorrelation from a time series?

Dieter Menne dieter.menne at menne-biomed.de
Thu May 15 17:39:46 CEST 2008


Claudia D'Aniello <kikki_80 <at> yahoo.it> writes:

> 
> Dear R users,
> someone knows how to remove auto-correlation from a frequencies time series?
> I've tried by differencing (lag 1) the cumulative series (in order to have
only positive numbers) , but I
> can't remove all auto-correlation.
> If it's useful I can send my db.
> 
> x <-             # autocorrelated series
> new1<-cumsum(x)
> new2<-diff(new1,lag=1,differences = 1)
> acf(new2)     # remains autocorrelated 
> 

This might come close to what your want

ar = arima(lh, order = c(1,0,0))
plot(ar$residuals)


Dieter



More information about the R-help mailing list