Re: [R] different results between cor and ccf

2024-01-16 Thread Berwin A Turlach
G'day Patrick, On Tue, 16 Jan 2024 09:19:40 +0100 Patrick Giraudoux wrote: [...] > So far so good, but when I lag one of the series, I cannot find the > same correlation as with ccf > > > cor(x[1:(length(x)-1)],y[2:length(y)]) [1] -0.7903428 > > ... where I expect -0.668 based on ccf > > Ca

[R] different results between cor and ccf

2024-01-16 Thread Patrick Giraudoux
Dear listers, I am working on a time series but find that for a given non-zero time lag correlations obtained by ccf and cor are different. x <- c(0.85472102802704641, 1.6008990694641689, 2.5019632258894835, 2.514654801253164, 3.3359198688206368, 3.5401357138398208, 2.6304117871193538, 3.66940