Re: [R] acf lag1 value

2008-01-17 Thread Shubha Vishwanath Karanth
2:27 PM To: Shubha Vishwanath Karanth Cc: [EMAIL PROTECTED] Subject: Re: [R] acf lag1 value Please re-check your time-series books. The acf at lag 1 is _not_ the correlation between x and lag(x). For one thing, the variance of x is computed from the whole series, and not from the series with

Re: [R] acf lag1 value

2008-01-17 Thread Prof Brian Ripley
Please re-check your time-series books. The acf at lag 1 is _not_ the correlation between x and lag(x). For one thing, the variance of x is computed from the whole series, and not from the series with either the first or last value removed -- there is also the question of the divisor. See MAS

[R] acf lag1 value

2008-01-17 Thread Shubha Vishwanath Karanth
Hi R, I have doubt. >x= c(4,5,6,3,2,4,5) >acf(x,plot=F,lag.max=1) Autocorrelations of series 'x', by lag 0 1 1.000 0.182 But if I actually calculate the autocorrelation at lag1 I get, >cor(x[-1],x[-length(x)]) [1] 0.1921538 Even in excel I get 0.1921538 val