Skip to main content

Module acov

Module acov 

Source
Expand description

Sample autocovariance / autocorrelation.

Functions§

acf
Sample autocorrelation for lags 0..=max_lag (acf[0] == 1).
autocovariance
Biased (divide-by-n) sample autocovariance for lags 0..=max_lag, after mean removal. The biased estimator keeps the Toeplitz matrix positive semi-definite, which Levinson–Durbin requires.
bartlett_se
Bartlett large-sample standard error of acf[k] under the hypothesis that the process is MA(k−1) (i.e. true autocorrelations vanish from lag k on): sqrt((1 + 2 Σ_{j<k} ρ_j²) / n). Used to studentize the ACF so that the Fine–Hwang threshold is scale-free for MA order selection.
inverse_acov_from_ar
Inverse autocovariances of a fitted AR(p), up to a 1/σ² factor that cancels in any correlation: for x_t = Σ φ_j x_{t-j} + e_t, vi(0) = 1 + Σ φ_i² and vi(k) = −φ_k + Σ_{i=1}^{p−k} φ_i φ_{i+k}. This is Cleveland’s (1972) autoregressive estimator of the inverse autocovariance function (his §4, in the α = −φ sign convention), and it is a genuine MA(p) autocovariance sequence, hence positive semi-definite.