Autocorrelation of a vector

https://juliastats.org/StatsBase.jl/v0.16/signalcorr.html#StatsBase.autocor

If x is a vector, return a vector of the same length as x.

julia> length(autocor(randn(2000)))
34

Why isn’t the result length 2000?

1 Like

https://juliastats.org/StatsBase.jl/stable/signalcorr/

" When left unspecified, the lags used are the integers from 0 to min(size(x,1)-1, 10*log10(size(x,1))) ."

julia> 10*log10(2000)
33.01029995663981

lag starting at 0 up to 33 gives 34 lags.

2 Likes