[R] acf gives correlations > 1
Duncan Murdoch
murdoch at stats.uwo.ca
Mon Sep 14 13:06:11 CEST 2009
On 14/09/2009 6:40 AM, Steve Jones wrote:
> Hi list,
>
> I've been producing autocorrelation functions of time series using the
> acf function, and have found a series or two for which correlations of >
> 1 are given, which I think shouldn't happen.
>
> Attached is the time series I'm using, and below is the R code (version
> 2.9.1) that I'm entering:
>
> series <- read.csv("series.csv")
> corr <- acf(series, lag.max=90, na.action=na.pass, plot=T)
>
> The first few values of corr are below:
>
> 0 1.000
> 1 1.258
> 2 1.192
> 3 1.266
> 4 0.864
> 5 0.637
>
> The entries of concern are 1-3 - surely these results are invalid?
>
> I'd be grateful if you could shed any light on this for me.
>
Your data file didn't show up. (Some attachments are stripped; it's
better to include data inline.)
Duncan Murdoch
More information about the R-help
mailing list