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
nobsobservations, trimmed atmax_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 havemax_lags + 1entries, 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_criteriacounts them, so the same model scores differently in the two places. Both are right in context; do not reconcile them.See also
BVAR.lag_order_selection()– returns an instance.GibbsBVAR.lag_order_selection()– returns an instance.GraphicalVAR.lag_order_selection()– returns an instance.HierarchicalBVAR.lag_order_selection()– returns an instance.
Attributes#
Longest order scored; every curve has |
|
The common effective sample every order was scored on. |
|
Akaike criterion by order, \(\log \det \Sigma + 2 m / T\). |
|
Schwarz criterion by order, \(\log \det \Sigma + m \log(T) / T\). |
|
Hannan-Quinn criterion by order, \(\log \det \Sigma + 2 m \log \log(T) / T\). |
|
Final prediction error by order. |
|
The order all four criteria agree on, or |
|
The orders scored, |
|
Each criterion's chosen order, keyed by criterion name. |