max_auto_corr: Compute the Maximum Autocorrelation

View source: R/autocorrelation.R

max_auto_corrR Documentation

Compute the Maximum Autocorrelation

Description

Compute the Maximum Autocorrelation

Usage

max_auto_corr(x, min_tau, max_tau)

Arguments

x

vector of distinct options of numbers or characters

min_tau

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

max_tau

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

Details

This function takes a vector x and uses it to compute the maximum autocorrelation for a specified interval of gaps tau from min_tau to max_tau. The resulting autocorrelation is the largest autocorrelation that could be observed in the interval for values of tau. A high autocorrelation indicates that there there is a high correlation between numbers in a sequence that are set apart from each other min_tau to max_tau values.

Value

maximum autocorrelation of x for the all gaps tau in the interval from min_tau to max_tau between subsequent numbers

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.