Hi all,

I am getting different results from ccf and cor,
Here is a simple example:

set.seed(100)
N <- 100
x1 <- sample(N)
x2 <- x1 + rnorm(N,0,5)
ccf(x1,x2)$acf[ccf(x1,x2)$lag == -1]
cor(x1[-N], x2[-1])


Results:

> ccf(x1,x2)$acf[ccf(x1,x2)$lag == -1]
[1] -0.128027
> cor(x1[-N], x2[-1])
[1] -0.1301427


Thanks,
Tal




----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------

	[[alternative HTML version deleted]]

