Autocorrelation, autocovariance, or partial autocorrelation function
Source:R/toolbox.R
autocorrelation.RdMirrors the C# Autocorrelation class. Computes the requested function out to max_lag
(default floor(min(10*log10(N), N-1)), matching the C# default) and attaches the asymptotic
confidence band for ACF/PACF rho values at confidence_level.
Usage
autocorrelation(
x,
max_lag = NULL,
type = c("correlation", "covariance", "partial"),
confidence_level = 0.95
)Value
a corehydro_autocorrelation list with lag, value, type, and the two-element
ci (lower, upper).
Examples
x <- c(5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 5, 6, 4, 7, 3, 8, 2, 9, 1, 10)
autocorrelation(x, max_lag = 5)
#> <corehydro_autocorrelation> type = correlation, 6 lag(s)