Johansen's maximum-likelihood approach estimates all cointegrating vectors at once, tests the rank, and treats all variables symmetrically. The derivation is a short exercise in partitioned determinants.
Take the VECM (13A.9)–(13A.10) with Gaussian errors εt∼N(0,Ω). Regress Δyt and yt−1 separately on the short-run regressors (1,Δyt−1,…,Δyt−p+1) and call the residuals R0t and R1t. By the Frisch–Waugh–Lovell theorem the likelihood, maximised over ν and the Γi, depends only on the concentrated model
R0t=αβ′R1t+ε~t.(13A.16)
Define moment matrices Sij=T−1∑tRitRjt′ for i,j∈{0,1}.
By (13A.17) we must minimise the ratio ∣β′(S11−S10S00−1S01)β∣/∣β′S11β∣ over n×r matrices β. The ratio is unchanged by β↦βM for invertible M, so normalise β′S11β=Ir; the problem becomes: minimise ∣Ir−β′S10S00−1S01β∣ subject to β′S11β=Ir. Write β=S11−1/2U with U′U=Ir and B=S11−1/2S10S00−1S01S11−1/2 (symmetric, eigenvalues λ^i∈[0,1), the same as those of (13A.18)). We minimise ∣Ir−U′BU∣. By the Poincaré separation theorem the eigenvalues μ1≥⋯≥μr of U′BU satisfy μi≤λ^i, so ∣Ir−U′BU∣=∏(1−μi)≥∏i≤r(1−λ^i), with equality when U spans the top r eigenvectors of B. Mapping back gives β=(v1,…,vr), and substituting into −2Tln∣Ω^∣ gives (13A.19).∎
The λ^i are the squared canonical correlations between R0 and R1: how much of the change in prices is predictable from each direction of the lagged levels.
From (13A.19), the likelihood-ratio statistic for H(r): rank ≤r, against H(n): unrestricted, is
λtrace(r)=−Ti=r+1∑nln(1−λ^i),(13A.20)
and for H(r) against H(r+1),
λmax(r)=−Tln(1−λ^r+1).(13A.21)
Test sequentially: r=0 first; if rejected, r=1; stop at the first non-rejection. The limiting distributions are functionals of an (n−r)-dimensional Brownian motion and depend on how the constant and trend enter (inside or outside the cointegrating relation; Johansen 1995 distinguishes five cases). For a pair with an unrestricted constant (coint_johansen(det_order=0) in statsmodels), the 5% critical values reported there are 15.49 (λtrace(0)), 14.26 (λmax(0)) and 3.84 (both tests at r=1).
Worked example
With T=800 and λ^=(0.030,0.002): λtrace(0)=−800[ln0.970+ln0.998]=24.37+1.60=25.97>15.49 and λmax(0)=24.37>14.26, so reject r=0; λtrace(1)=λmax(1)=1.60<3.84, so do not reject r≤1. Conclusion: one cointegrating vector, β^=v1. Problem 13A.6 has a case where the r=1 test also rejects, and asks what that means for a pair of prices.
Practitioner notes
Johansen tests are oversized in small samples with many lags. Use as few lags as the residual diagnostics allow.
The estimated β^ from Johansen can have heavy tails in small samples. For a two-asset spread, EG with a fixed, economically sensible hedge ratio is often more stable. Use Johansen for baskets (n≥3), where EG cannot count the vectors.