auto_corr: Compute Autocorrelation

View source: R/autocorrelation.R

auto_corrR Documentation

Compute Autocorrelation

Description

Compute Autocorrelation

Usage

auto_corr(x, tau)

Arguments

x

vector of distinct options of numbers or characters

tau

numeric indicating the gap between subsequent numbers for which the autocorrelation will be computed

Details

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.

Value

autocorrelation of x for the gap between subsequent numbers tau

Examples

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)


TImA97/randfindR documentation built on July 1, 2024, 7:56 p.m.