Autocorrelation
Estimation

For a discrete process with known mean and variance for which we observe n {\displaystyle n} observations { X 1, X 2, …, X n } {\displaystyle \{X_{1},\,X_{2},\,\ldots,\,X_{n}\}}, an estimate of the autocorrelation coefficient may be obtained as

R ^ (k) = 1 (n − k) σ 2 ∑ t = 1 n − k (X t − μ) (X t + k − μ) {\displaystyle {\hat {R}}(k)={\frac {1}{(n-k)\sigma ^{2}}}\sum _{t=1}^{n-k}(X_{t}-\mu)(X_{t+k}-\mu)}

for any positive integer k < n {\displaystyle k<n}. When the true mean μ {\displaystyle \mu } and variance σ 2 {\displaystyle \sigma ^{2}} are known, this estimate is unbiased. If the true mean and variance of the process are not known there are several possibilities:

The advantage of estimates of the last type is that the set of estimated autocorrelations, as a function of k {\displaystyle k}, then form a function which is a valid autocorrelation in the sense that it is possible to define a theoretical process having exactly that autocorrelation. Other estimates can suffer from the problem that, if they are used to calculate the variance of a linear combination of the X {\displaystyle X} 's, the variance calculated may turn out to be negative.
oulipo:avoid_letter[t], length_constraints:number_words[311]