[R] interpreting acf plot

Ben Bolker bolker at ufl.edu
Sat Apr 17 19:29:15 CEST 2010

Giovanni Azua <bravegag <at> gmail.com> writes:

> Hello,
> I am attending a course in Computational Statistics at 
> ETH and in one of the assignments I am asked to prove
> that a time series is not autocorrelated using the R function "acf".
> I tried out the acf function with the given data, 
> according to what I found here:
> http://landshape.org/enm/options-for-acf-in-r/ 
> this test data does not look IID but rather shows
> some trends so how can I then prove that it is not 
> autocorrelated? maybe the trends are ok? 
> I have bought several titles on R but none really explains 
> autocorrelation or how to interpret the acf
> function ... the integrated help is also a bit dry. 


  The acf() shows what looks to be fairly mild autocorrelation
at lag 1  (rho=0.09228), which is strongly significant according
to the Durbin-Watson test ...

> aa <- acf(bmwlr)
> aa$acf[2]  ## 0.09228

> library(car)
> durbinWatsonTest(lm(bmwlr~1))
 lag Autocorrelation D-W Statistic p-value
   1      0.09228737      1.815334   0.002
 Alternative hypothesis: rho != 0

However, I don't know where you're getting the idea of a trend
from: the plot looks noisy (although there is one big excursion
in the middle) ?  Are you confusing "trend" with "autocorrelation"?

  I would suggest general time-series books -- Chatfield has several
at various levels.

More information about the R-help mailing list