pairs-trading-lab
methods · diagnostics

Methods — five tests, one verdict.

Most papers use ADF in isolation. Real desks stack tests with opposing nulls and complementary power. This page runs ADF + Engle-Granger, KPSS (opposite null), Variance Ratio (Lo-MacKinlay), Hurst (R/S), CUSUM (Brown-Durbin-Evans), and Johansen (full system) on the same spread, then summarises the verdict.

Pair

Verdict

MEGA-WHEN
ADF τ-8.56reject UR? yes
Engle-Grangerp≈0.005
KPSS η0.388stationary? yes (cv 0.463)
VR(5) z1200.65trending
Hurst H0.84trending
CUSUMbreakfirst @ 2023-09-27
Johansen trace r=0147.8cv5% 15.41

Strong evidence: ADF rejects (small τ), Engle-Granger cointegrated, KPSS does notreject (η below cv), VR(5) below 1 with negative z, Hurst < 0.5, CUSUM stable, Johansen trace rejects r=0. A pair that passes 6 of 7 is robust; anything below 4 is noise.

Variance Ratio profile (Lo-MacKinlay)

VR(q) at multiple horizons

VR(q) < 1 across multiple horizons is strong evidence of mean reversion; negative z-statistic at the same horizons makes it statistically reliable.

CUSUM of mean-shifts (Brown-Durbin-Evans 1975)

structural break detected

Brownian-motion-like envelope under H0 (constant β). The CUSUM crossing a band ⇒ the relationship has shifted and the spread is no longer the same statistical object.

Hurst exponent — R/S regression

slope = H = 0.838, R² = 0.997

log(R/S) on log(n). A 45° slope means H = 0.5 (random walk). H < 0.5 is mean reversion — the property we want for a tradable spread.

Half-life sensitivity to window length

OU fit on trailing windows

A robust pair shows similar half-life across windows. Wide variance ⇒ the mean-reversion speed is itself drifting (regime-shifting), and the OU model is being asked to do too much.

Johansen — the multivariate sibling of Engle-Granger

2-variable trace + max-eigenvalue
Trace test
r ≤ 0147.83 ✔ reject
r ≤ 116.03 ✔ reject
cv5% r=0 = 15.41, r=1 = 3.76
Max-eigenvalue test
r = 0 vs r = 1131.80
eigenvalues0.099, 0.013
cointegration vector(1.00, -1.12)

Johansen estimates all cointegration vectors at once (no "regress y on x" asymmetry) and is the right tool when you have ≥ 3 assets. With 2 assets it should agree with Engle-Granger; with broken pairs it's typically the more forgiving test.