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#

eigenvalues

The squared canonical correlations, descending.

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

Empirical p-values from the simulated null.

max_eigenvalue_pvalue

Empirical p-values from the simulated null.

nobs

Effective sample the statistics were computed on.

deterministic

The Johansen case the null was simulated under.

k_exog

Weakly exogenous integrated regressors the null accounted for.

simulations

Replications behind each p-value, so its resolution is visible rather than implied.

small_sample

Whether the Reinsel-Ahn degrees-of-freedom scaling was applied to the statistics.

k_endog

Number of modelled equations, which bounds the rank.

ranks

The null ranks tested, in order.

Methods#

selected_rank(*[, alpha, statistic])

First rank the sequence fails to reject.

to_table(*[, alpha])

Render both sequences with the rank each one selects.