| cross_correlation | R Documentation |
This is stats::ccf() as a data frame. r at lag k estimates
cor(x[t + k], y[t]). A peak at a negative lag means that x changes
before y.
cross_correlation(x, y, max_lag = 12)
x |
First series |
y |
Second series, same length as |
max_lag |
Largest lag to return, in steps |
Data frame with lag (-max_lag to max_lag) and r
rain <- sin(1:48 / 2)
searches <- c(rain[-1], 0)
cross_correlation(searches, rain, max_lag = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.