Fast evaluation of autocorrelation functions
for scalar processes
for vector processes
Specifically, the acf
function evaluates autocorrelation estimates
of the form
with optional arguments to subtract the mean of the process or to normalize the resulting autocorrelation function.
acf(x; demean=true)
:
acf(x; normalize=true)
:
using Autocorrelations
n = 1000
σ = 0.1
τ = 3
t = range(0, 3π; length=n)
x = sin.(t) .* exp.(-t./τ) .+ randn(n).*σ
f1 = acf(x)
lags = round.(Int,range(10, size(x,1)-1; length = 11))
f2 = acf(x, lags)
f3 = acf(x; normalize=true)
f4 = acf(x; normalize=true, demean=true)