Skip to content
On this page
  1. Key Takeaways
  2. What It Is
  3. The Intuition
  4. How It Works
  5. Worked Example
  6. Common Mistakes
  7. Frequently Asked Questions
  8. Sources
  9. Disclaimer
← All concepts
SignalsAdvanced5 min read

Johansen Cointegration Test: Multi-Asset Long-Run Relationships

The Johansen test identifies how many independent long-run equilibrium relationships exist among a set of two or more non-stationary time series. It generalizes the Engle-Granger framework to systems and does not require you to pick one variable as the left-hand side.

Key Takeaways

  • The Johansen test uses trace and maximum-eigenvalue statistics to determine the rank of the cointegrating matrix, telling you how many independent long-run equilibria exist among a basket of assets.
  • A three-ETF energy basket test found two cointegrating vectors, two independent tradeable spread structures, with trace statistics of 128.6 and 33.3 both exceeding their respective 5 percent critical values.
  • The most important advantage over Engle-Granger is symmetry: Johansen treats all variables equally and finds all K cointegrating vectors simultaneously, whereas Engle-Granger forces you to choose a dependent variable that changes the estimated coefficients.
  • Finding rank = 3 statistically does not mean all three vectors are equally tradeable; inspect the adjustment speeds in the alpha matrix to determine which relationships mean-revert quickly enough to be actionable.

Key Takeaways

  • The Johansen test uses trace and maximum-eigenvalue statistics to determine the rank of the cointegrating matrix, telling you how many independent long-run equilibria exist among a basket of assets.
  • A three-ETF energy basket test found two cointegrating vectors, two independent tradeable spread structures, with trace statistics of 128.6 and 33.3 both exceeding their respective 5 percent critical values.
  • The most important advantage over Engle-Granger is symmetry: Johansen treats all variables equally and finds all K cointegrating vectors simultaneously, whereas Engle-Granger forces you to choose a dependent variable that changes the estimated coefficients.
  • Finding rank = 3 statistically does not mean all three vectors are equally tradeable; inspect the adjustment speeds in the alpha matrix to determine which relationships mean-revert quickly enough to be actionable.

What It Is

The Johansen cointegration test is built on a vector error correction model (VECM). For N time series, there can be between 0 and N-1 cointegrating vectors. Johansen's method estimates them jointly by maximum likelihood and tests the rank of the long-run matrix via two likelihood-ratio statistics: the trace test and the maximum eigenvalue test.

This makes it the standard tool for multi-asset stat arb, yield curve spreads, and currency triangles where three or more series share a common stochastic trend.

The Intuition

Pairs are the easy case. Engle-Granger handles them fine. But consider a basket: three stock index futures, the 2/5/10 year Treasury curve, or a set of currencies pegged to the dollar. A single regression forces you to pick a dependent variable, which changes the estimated coefficients depending on the choice. Johansen treats all variables symmetrically and finds all independent long-run relationships at once.

If two relationships exist (rank = 2), you have two tradeable spread structures. If rank = 0, the system shares no long-run equilibrium and the basket is not cointegrated.

How It Works

Start from a vector autoregression of order k for an N-dimensional series y_t. Rewrite in VECM form:

dy_t = Pi * y_{t-1} + sum_{i=1..k-1} Gamma_i * dy_{t-i} + mu + e_t

The long-run matrix Pi has rank r, where r is the number of cointegrating vectors. Johansen factors Pi = alpha * beta', with beta (N x r) being the cointegrating vectors and alpha (N x r) the adjustment speeds.

Estimation reduces to a generalized eigenvalue problem. Let lambda_1 >= lambda_2 >= ... >= lambda_N be the estimated eigenvalues. The trace test statistic for the null of at most r cointegrating vectors is:

trace(r) = -T * sum_{i=r+1..N} ln(1 - lambda_i)

The maximum eigenvalue test for the null of exactly r against r+1 is:

lambda_max(r) = -T * ln(1 - lambda_{r+1})

You compare each statistic to critical values tabulated by MacKinnon, Haug, and Michelis. The standard procedure tests r = 0, then r = 1, and stops when you fail to reject.

Worked Example

Consider three ETFs on the same sector: XLE, USO, and an energy sub-index. Daily log prices for 2018-2024 are tested jointly. Johansen estimation with lag order k = 2 and an unrestricted constant yields sample eigenvalues approximately 0.062, 0.018, and 0.004 on T = 1,500 observations.

Trace statistics:

trace(0) = -1500 * (ln(0.938) + ln(0.982) + ln(0.996)) = 128.6
trace(1) = -1500 * (ln(0.982) + ln(0.996))             = 33.3
trace(2) = -1500 * ln(0.996)                           = 6.0

Suppose the 5 percent critical values are 35.2, 20.3, and 9.2. You reject r = 0 (128.6 > 35.2) and reject r = 1 (33.3 > 20.3) but fail to reject r = 2 (6.0 < 9.2). Conclusion: the three series support two cointegrating vectors. You now have two tradeable spreads, each with its own beta coefficients and mean-reversion half-life.

Common Mistakes

  1. Picking lag order by eyeball. The lag order k has to whiten residuals of the VECM. Use AIC or BIC on the VAR in levels, then run diagnostic checks (Ljung-Box on residuals). Wrong lags bias the test.

  2. Using the wrong deterministic specification. Johansen has five standard cases ranging from no constant/no trend to constant and trend in both the cointegration space and the data. Mismatched specification can make the test accept or reject spuriously. Pick based on whether your data appears to trend deterministically.

  3. Reading the two statistics inconsistently. Trace tests a cumulative null; max-eigenvalue tests a pointwise one. They can disagree near the threshold. When they do, follow the trace test and tighten your confidence level.

  4. Ignoring small-sample power. Johansen critical values are asymptotic. With fewer than 200 observations, rejection rates can be inflated. Bootstrap critical values or reserve the test for reasonably long samples.

  5. Trading too many vectors blindly. If Johansen says r = 3, that means three statistically independent relationships exist, not that you should allocate equally to all three. Inspect the adjustment speeds in alpha and the economic interpretation of each beta before deciding which are tradeable.

Frequently Asked Questions

Q: What is the Johansen cointegration test in simple terms? It is a statistical procedure that tests how many independent long-run equilibrium relationships exist among a group of non-stationary time series. For a basket of three or more assets, it tells you the number of tradeable cointegrating spreads without requiring you to arbitrarily designate one asset as the dependent variable.

Q: How does the Johansen test affect investment decisions? It enables multi-asset stat-arb strategies by finding all valid long-run relationships simultaneously. If the test finds rank = 2 in a three-ETF basket, you have two independent spread structures to trade, each with its own hedge ratios and mean-reversion speed, rather than one.

Q: What is a real-world example of using the Johansen test? Three energy ETFs (XLE, USO, and an energy sub-index) are tested jointly over 2018–2024. The trace statistic sequence rejects rank 0 and rank 1 but fails to reject rank 2, concluding two cointegrating vectors exist. The betas from those two vectors define two separate spread portfolios, each tested for tradeable mean-reversion half-life.

Q: How can investors avoid the lag order mistake in the Johansen test? Select the lag order k for the underlying VAR using AIC or BIC, then verify that VECM residuals are white noise using a Ljung-Box test. If residuals remain autocorrelated at the chosen lag order, increase k until the autocorrelation disappears before reading the cointegration rank result.

Q: How is the Johansen test different from the Engle-Granger test? Engle-Granger handles exactly two variables and produces a single cointegrating relationship whose estimate depends on which variable is on the left-hand side of the regression. Johansen handles N variables symmetrically, finds all K independent relationships at once, and does not privilege any ordering, making it the correct tool for baskets of three or more assets.

Sources

  1. Johansen, S. (1991). "Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models." Econometrica 59(6), 1551-1580. https://www.econometricsociety.org/publications/econometrica/1991/11/01/estimation-and-hypothesis-testing-cointegration-vectors
  2. Johansen, S. (1995). Likelihood-based Inference in Cointegrated Vector Autoregressive Models. Oxford University Press. https://academic.oup.com/book/26345
  3. MacKinnon, J.G., Haug, A.A., Michelis, L. (1999). "Numerical Distribution Functions of Likelihood Ratio Tests for Cointegration." https://www.econ.queensu.ca/sites/econ.queensu.ca/files/qed_wp_1227.pdf
  4. Juselius, K. (2006). The Cointegrated VAR Model: Methodology and Applications. Oxford University Press. https://academic.oup.com/book/31705

Disclaimer

This article is educational content only and is not financial advice. Nothing here is a recommendation to buy, sell, or hold any security. Consult a licensed advisor before making investment decisions.

The IWP Substack

You understand the concept. Now see it applied.

The Investing With Purpose Substack turns ideas like this into research and risk-managed trade plans on real stocks, updated every week.

Read on Substack (opens in a new tab)

Related concepts