JohansenRankTest#
- class cultivars.diagnostics.cointegration.JohansenRankTest(*, eigenvalues, trace_statistic, max_eigenvalue_statistic, trace_pvalue, max_eigenvalue_pvalue, nobs, deterministic, k_exog, simulations, small_sample)[source]#
Sequential trace and maximum-eigenvalue tests for the cointegrating rank.
Both sequences read down from \(r = 0\). The trace statistic tests \(\operatorname{rank} \le r\) against \(\operatorname{rank} = k\); the maximum-eigenvalue statistic tests \(\operatorname{rank} = r\) against \(\operatorname{rank} = r + 1\). The conventional reading stops at the first \(r\) that is not rejected, which
selected_rank()implements and which is a sequential procedure whose overall size is not the nominal level of any single step – a caveat the table states rather than hides.With \(\hat\lambda_1 \ge \cdots \ge \hat\lambda_k\) the squared canonical correlations and \(T^{\ast}\) the effective sample size, the two statistics for the null of at most \(r\) cointegrating relations are
\[\lambda_{\mathrm{trace}}(r) = -T^{\ast} \sum_{i=r+1}^{k} \log(1 - \hat\lambda_i), \qquad \lambda_{\max}(r) = -T^{\ast} \log(1 - \hat\lambda_{r+1}), \qquad r = 0, \ldots, k - 1.\]Under the small-sample correction of Reinsel and Ahn (1992), \(T^{\ast} = T - (k_y + k_x)\, p\) with \(p\) the lag order; otherwise it is \(T\). Neither statistic has a standard limit law: the reference distribution depends on the deterministic case and on the number of weakly exogenous regressors, which is why the record carries simulated p-values together with the settings they were simulated under.
- Variables:
eigenvalues (
NDArray[double]) – The squared canonical correlations, descending. One per modelled equation, since a conditional system cannot support more cointegrating relations than it has equations.trace_statistic – One entry per null \(\operatorname{rank} \le r\), for \(r = 0, \ldots, k - 1\).
max_eigenvalue_statistic – One entry per null \(\operatorname{rank} = r\).
trace_pvalue (
NDArray[double]) – Empirical p-values from the simulated null.max_eigenvalue_pvalue (
NDArray[double]) – Empirical p-values from the simulated null.nobs (
int) – Effective sample the statistics were computed on.deterministic (
str) – The Johansen case the null was simulated under.k_exog (
int) – Weakly exogenous integrated regressors the null accounted for.simulations (
int) – Replications behind each p-value, so its resolution is visible rather than implied.small_sample (
bool) – Whether the Reinsel-Ahn degrees-of-freedom scaling was applied to the statistics.
See also
JohansenRankTest– the public name of this class.VECM.rank_test()– returns an instance.VECMX.rank_test()– returns an instance._ExogenousVectorErrorCorrectionModel.rank_test()– returns an instance._VectorErrorCorrectionModel.rank_test()– returns an instance.
Attributes#
The squared canonical correlations, descending. |
|
One entry per null \(\operatorname{rank} \le r\), for \(r = 0, \ldots, k - 1\). |
|
One entry per null \(\operatorname{rank} = r\). |
|
Empirical p-values from the simulated null. |
|
Empirical p-values from the simulated null. |
|
Effective sample the statistics were computed on. |
|
The Johansen case the null was simulated under. |
|
Weakly exogenous integrated regressors the null accounted for. |
|
Replications behind each p-value, so its resolution is visible rather than implied. |
|
Whether the Reinsel-Ahn degrees-of-freedom scaling was applied to the statistics. |
|
Number of modelled equations, which bounds the rank. |
|
The null ranks tested, in order. |
Methods#
|
First rank the sequence fails to reject. |
|
Render both sequences with the rank each one selects. |