View source: R/autocorrelation.R
auto_corr | R Documentation |
Compute Autocorrelation
auto_corr(x, tau)
x |
vector of distinct options of numbers or characters |
tau |
numeric indicating the gap between subsequent numbers for which the autocorrelation will be computed |
This function takes a vector x
and uses it to compute the autocorrelation
for a specified gap tau tau
. This is done by correlating the original vector x
with the same sequence starting tau
values later. A high autocorrelation
for a specified value tau
indicates that there is a high correlation
between numbers in a sequence that are tau
values apart from each other.
autocorrelation of x
for the gap between subsequent numbers tau
max_auto_corr(c(1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2), tau = 2)
max_auto_corr(c(1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2), tau = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.