LagOrderSelection#

class cultivars.diagnostics.stability.LagOrderSelection(*, max_lags, nobs, aic, bic, hqic, fpe)[source]#

Lag-order criteria evaluated over a common sample.

Carries the whole curve for each criterion, not just the winner. The four routinely disagree – Bayesian and Hannan-Quinn penalize harder than Akaike and final prediction error, so they pick shorter – and a caller shown only four integers cannot tell a decisive choice from a coin flip between two orders whose criteria differ in the fourth decimal.

Every order was scored on the same nobs observations, trimmed at max_lags. That is what makes the entries of a curve comparable to each other; scoring each order on its own natural sample would bias the choice toward short lags, because a longer sample lowers the log-determinant for reasons that have nothing to do with fit.

Variables:
  • max_lags (int) – Longest order scored; the curves have max_lags + 1 entries, indexed by order from zero.

  • nobs (int) – The common effective sample every order was scored on.

  • aic (NDArray[double]) – Akaike criterion, \(\log \det \Sigma + 2 m / T\).

  • bic (NDArray[double]) – Schwarz criterion, \(\log \det \Sigma + m \log(T) / T\).

  • hqic (NDArray[double]) – Hannan-Quinn criterion, \(\log \det \Sigma + 2 m \log \log(T) / T\).

  • fpe (NDArray[double]) – Final prediction error. On a determinant scale rather than a log-determinant one, so its values are not comparable with the other three – only its own minimum is meaningful.

Note

The parameter count \(m\) here excludes the innovation covariance, following Lutkepohl: those terms are common across orders and cancel. A fitted result’s information_criteria counts them, so the same model scores differently in the two places. Both are right in context; do not reconcile them.

See also

Attributes#

max_lags

Longest order scored; every curve has max_lags + 1 entries, indexed by order.

nobs

The common effective sample every order was scored on.

aic

Akaike criterion by order, \(\log \det \Sigma + 2 m / T\).

bic

Schwarz criterion by order, \(\log \det \Sigma + m \log(T) / T\).

hqic

Hannan-Quinn criterion by order, \(\log \det \Sigma + 2 m \log \log(T) / T\).

fpe

Final prediction error by order.

consensus

The order all four criteria agree on, or None when they differ.

orders

The orders scored, 0 through max_lags.

selected

Each criterion's chosen order, keyed by criterion name.

Methods#

best(criterion)

The order minimizing one criterion.

curve(criterion)

The full criterion curve, indexed by order.

to_table()

The criterion curves as one table, minima marked.