Skip to content

ccf(x,y) vs. cor() of x and lagged values of y

2 messages · Mihnea Constantinescu, R. Michael Weylandt

1 day later
#
On Fri, Oct 12, 2012 at 12:28 AM, Mihnea Constantinescu
<mihnea.const at gmail.com> wrote:
I'd bet that you'd also find that

cor(x,y) = cor(x, lag(y,-1))

? That's because the effect of "lagging" seems to be discarded by
cor() which only looks at the data itself and doesn't align the
observations. The ccf() result is the one you want.

Cheers,
Michael