Home / Financial Tools / Cointegration & Structural Break Econometric Tester

Graduate-Level Modeling · Time Series Econometrics

Cointegration & Structural Break Econometric Tester

Two series can genuinely move together for years, shift to a new equilibrium, and still get called "not cointegrated" by a test that never saw the break coming.

How To Use This Model

Reading This Tool

Simulate two price series with a controllable degree of cointegration and an optional structural break in their equilibrium spread.

The tool runs the full Engle-Granger two-step test, an OLS regression followed by an Augmented Dickey-Fuller test on the residuals, and a separate test for a level shift in the spread, so you can see exactly how a structural break can quietly break the cointegration test itself.

Simulation Controls

Cointegration strength of 0% simulates a spread that's essentially a second random walk (no genuine long-run relationship), 100% simulates a fast, strongly mean-reverting spread. The break, if set above zero, shifts the spread's equilibrium level partway through the sample.

Engle-Granger Cointegration Test

-

OLS Cointegrating Beta

-

ADF t-Statistic On Residuals

-

Structural Break F-Statistic

-

Break Detected?

-

The Estimated Spread (OLS Residual) Being Tested For Stationarity

-

-

What The ADF Test Is Actually Checking

-

How A Structural Break Can Quietly Break The Cointegration Test

-

Why This Matters For Pairs Trading And Hedge Ratios

A pairs trade or hedge ratio built on a cointegrating relationship implicitly assumes that relationship is stable. If the true equilibrium shifted partway through your estimation sample, without you knowing, your OLS beta and your mean-reversion assumption are both quietly wrong for the current regime, exactly why real quant desks re-test for breaks on a rolling basis rather than estimating once and trusting it indefinitely.

The Two Underlying Series

Series ASeries B
Time Series Econometrics

The Core Formulas

Step 1: Bt = c + β·At + residt (OLS)
Step 2: Δresidt = ρ·residt−1 + φ·Δresidt−1 + εt (Augmented Dickey-Fuller, 1 lag)
Reject unit root (conclude cointegrated) if t(ρ) < approx. −3.34 (5% MacKinnon critical value)
Level-Shift F = [(SSRpooled − SSRsplit)/1] / [SSRsplit/(N−2)]

When To Actually Use This Method

  • Teaching the Engle-Granger two-step cointegration procedure and unit root testing in a time series econometrics or quantitative finance course.
  • Building intuition for statistical arbitrage and pairs trading, and why a cointegrating relationship needs to be periodically re-validated, not assumed permanent.
  • Illustrating, concretely, how an undetected structural break can produce a false "not cointegrated" conclusion even when a genuine long-run relationship exists either side of the break.

Key Assumptions & Limitations

  • Uses fixed, approximate MacKinnon-style critical values for illustration, exact critical values depend on sample size and the number of regressors, and should be pulled from statistical software for any real analysis.
  • The Johansen procedure is the standard alternative for testing cointegration among more than two series, or when the direction of the long-run relationship isn't known in advance.
  • The structural break test implemented here detects a level shift in the spread specifically, a full Chow test on the original regression would test for a break in both the intercept and the cointegrating slope simultaneously.

Foundational References

Engle, R. F., & Granger, C. W. J. (1987). Co-Integration and Error Correction: Representation, Estimation, and Testing. Econometrica, 55(2), 251-276.

Dickey, D. A., & Fuller, W. A. (1979). Distribution of the Estimators for Autoregressive Time Series with a Unit Root. Journal of the American Statistical Association, 74(366), 427-431.

Need a mean-reversion speed calibrated too?