Home / Wiki / J / Johansen Test

Johansen Test

Economics Markets and Financial TheoryUpdated 15 Nov 2026

The Johansen test is a statistical procedure for determining whether a group of non-stationary time series are tied together by one or more long-run equilibrium relationships, a property called cointegration. Unlike simpler methods, it handles more than two series at once and reports how many independent cointegrating relationships exist. It was developed by the Danish statistician Søren Johansen in papers published in 1988 and 1991.

In economics the test is used to study variables that trend together, such as interest rates of different maturities or prices and exchange rates. In quantitative trading it is used to find baskets of assets whose weighted combination is stationary and so tends to return to a mean, which is the statistical basis of pairs trading and other forms of statistical arbitrage.

01

The model behind the test

The test starts from a vector autoregression, an extension of autoregression to several series, rewritten in error-correction form:

ΔXt=ΠXt−1+∑i=1p−1ΓiΔXt−i+εt\Delta X_t = \Pi X_{t-1} + \sum_{i=1}^{p-1} \Gamma_i \Delta X_{t-i} + \varepsilon_t
  • XtX_t is the vector of the nn series at time tt, for example the log prices of nn assets.
  • ΔXt\Delta X_t is the change in that vector from one period to the next.
  • Π\Pi is an n×nn \times n matrix that captures the long-run relationships among the levels.
  • Γi\Gamma_i are matrices that capture short-run dynamics, and pp is the number of lags.
  • εt\varepsilon_t is a vector of random errors.

Everything turns on the rank of Π\Pi, written rr. If the rank is zero, there is no cointegration and the series wander independently. If the rank is between 1 and n−1n - 1, there are rr cointegrating relationships. If the rank is nn, the series were stationary to begin with. The procedure estimates the eigenvalues of a matrix related to Π\Pi, ordered from largest to smallest, and tests how many of them differ from zero.

02

Trace and maximum eigenvalue statistics

Two test statistics are used. The trace statistic tests the null hypothesis that there are at most rr cointegrating relationships:

λtrace(r)=−T∑i=r+1nln⁡(1−λ^i)\lambda_{\text{trace}}(r) = -T \sum_{i=r+1}^{n} \ln(1 - \hat{\lambda}_i)

The maximum eigenvalue statistic tests exactly rr relationships against r+1r + 1:

λmax⁡(r)=−Tln⁡(1−λ^r+1)\lambda_{\max}(r) = -T \ln(1 - \hat{\lambda}_{r+1})

Here TT is the number of observations and λ^i\hat{\lambda}_i is the ii-th largest estimated eigenvalue. The tests are run in sequence, starting with r=0r = 0 and stopping the first time the null is not rejected. Each statistic is compared with a critical value from tables produced by simulation, because the statistics do not follow a standard distribution.

Suppose two price series are tested over 500 days and the estimated eigenvalues are 0.04 and 0.005. For r=0r = 0, the trace statistic is −500×(ln⁡0.96+ln⁡0.995)=22.9-500 \times (\ln 0.96 + \ln 0.995) = 22.9. That exceeds the 5 percent critical value of about 15.5 for two series with a constant, so the null of no cointegration is rejected. For r≤1r \le 1, the statistic is −500×ln⁡0.995=2.5-500 \times \ln 0.995 = 2.5, below the critical value of about 3.8, so the null is not rejected. The conclusion is that there is one cointegrating relationship.

03

Use in trading

The eigenvector associated with each significant eigenvalue gives the weights of a stationary combination of the series. For two assets it serves as the hedge ratio. For three or more it defines a basket, such as a set of related exchange traded funds or futures on linked commodities. A trader computes the value of the basket over time, checks that it shows mean reversion, and trades it when it moves far from its average, buying the basket when it is low and selling when it is high.

The test has two practical advantages over the Engle-Granger method, which regresses one series on the others and then applies an augmented Dickey-Fuller test to the residuals. The Johansen procedure does not require choosing which series is the dependent variable, so the result does not change with the ordering. It can also detect several cointegrating relationships in a larger group, where the two-step method finds at most one.

04

Limitations

The results depend on choices made by the analyst. The number of lags and the treatment of constants and trends in the model both change the statistics and the critical values that apply, and different choices can lead to different conclusions. The test assumes that each series is non-stationary in levels and stationary in first differences, which should be checked beforehand. It can be unreliable in small samples, and the trace and maximum eigenvalue statistics sometimes disagree.

For traders the larger risk is that a relationship found in historical data does not persist. Cointegration between two shares can end with a merger, a change in business mix or a shift in regulation. Testing many candidate baskets and keeping those that pass invites overfitting, since some will pass by chance. A statistically valid relationship may also revert too slowly, or by too little, to cover transaction costs. Practitioners therefore combine the test with out-of-sample checks and an economic reason for the link, as discussed under stationarity and hypothesis testing.

Last updated 15 Nov 2026