Inferensys

Glossary

Cointegration

A statistical property where a linear combination of non-stationary asset prices is stationary, forming the basis for mean-reverting pairs trading strategies.
Enterprise integration architect reviewing API connections on laptop, diagram showing systems connecting, modern office setup.
MEAN-REVERSION FOUNDATION

What is Cointegration?

Cointegration is a statistical property of a time series portfolio where a linear combination of non-stationary asset prices is stationary, forming the basis for mean-reverting pairs trading strategies.

Cointegration is a statistical relationship between two or more non-stationary time series where a specific linear combination of them produces a stationary process. Unlike correlation, which measures short-term directional alignment, cointegration identifies a long-run equilibrium relationship. If a portfolio of assets is cointegrated, the spread between them is mean-reverting, meaning deviations from the equilibrium are temporary and will eventually correct, creating a predictable trading signal.

The classic test for cointegration is the Engle-Granger two-step method, which first regresses one asset price on another to estimate the cointegrating vector, then tests the residuals for stationarity using an augmented Dickey-Fuller test. In pairs trading, a trader goes long the undervalued asset and short the overvalued one when the spread widens beyond a threshold, profiting as it reverts. The half-life of mean reversion quantifies how quickly this convergence occurs, directly informing optimal trade duration and position sizing.

Statistical Foundations

Key Characteristics of Cointegration

Cointegration is a statistical property of a time series portfolio where a linear combination of non-stationary asset prices is stationary, forming the basis for mean-reverting pairs trading strategies.

01

Stationary Linear Combination

The core property of cointegration is that while individual asset price series are non-stationary (containing unit roots), a specific linear combination of them is stationary. This means the spread between the assets has a constant mean and variance over time, reverting to equilibrium rather than wandering randomly. Formally, if two I(1) series X and Y are cointegrated, there exists a coefficient β such that X - βY is I(0). This stationary spread is the tradable signal in pairs trading.

02

Long-Run Equilibrium Relationship

Cointegration implies a long-run equilibrium relationship between the assets. Economic forces or shared risk factors bind the series together, preventing them from diverging indefinitely. When the spread deviates from this equilibrium, it is expected to revert, creating a trading opportunity. This contrasts with correlation, which measures short-term directional co-movement but says nothing about long-run convergence. Two assets can be highly correlated yet not cointegrated if their prices drift apart over time.

03

Engle-Granger Two-Step Method

The Engle-Granger test is a classic method for detecting cointegration:

  • Step 1: Regress one asset price on the other using OLS to estimate the cointegrating vector: Y = α + βX + ε
  • Step 2: Test the residuals ε for a unit root using the Augmented Dickey-Fuller (ADF) test. If the residuals are stationary, the series are cointegrated. This method is simple but assumes one asset is the dependent variable, which can produce different results depending on the ordering.
04

Johansen Multivariate Test

The Johansen test extends cointegration analysis to multiple time series simultaneously, overcoming the limitations of the Engle-Granger approach. It uses a Vector Error Correction Model (VECM) framework to identify the number of cointegrating relationships (the cointegrating rank) in a system of n variables. The test provides two statistics:

  • Trace statistic: Tests the null of r or fewer cointegrating vectors
  • Maximum eigenvalue statistic: Tests the null of exactly r cointegrating vectors against r+1 This method is symmetric and does not require choosing a dependent variable.
05

Error Correction Mechanism (ECM)

Cointegrated systems exhibit an error correction mechanism: short-term deviations from the long-run equilibrium are corrected over time. The ECM model captures this dynamic by including the lagged residual (the error correction term) as a regressor:

  • ΔY_t = α(Y_{t-1} - βX_{t-1}) + γΔX_t + ε_t The coefficient α measures the speed of adjustment back to equilibrium. A negative and significant α confirms that the dependent variable adjusts to correct disequilibrium. This framework separates long-run equilibrium dynamics from short-run fluctuations.
06

Half-Life of Mean Reversion

The half-life of mean reversion quantifies how quickly a cointegrated spread reverts to its mean after a deviation. It is calculated from the error correction coefficient α as:

  • Half-Life = -ln(2) / ln(1 + α) A shorter half-life indicates faster reversion and is generally more desirable for trading, as it implies more frequent round-trip trades. However, very short half-lives may indicate noise rather than a genuine tradable signal. Typical half-lives for viable pairs range from a few days to several weeks.
COINTEGRATION EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about cointegration, its statistical foundations, and its application in mean-reverting trading strategies.

Cointegration is a statistical property of a multivariate time series where a linear combination of two or more non-stationary price series is itself stationary. In practical terms, this means that while individual asset prices may wander randomly without a fixed mean, a specific weighted combination of them—called the cointegrating vector—reverts to a long-run equilibrium. The mechanism relies on an error correction model (ECM): when the spread between the assets deviates from its historical mean, economic forces or arbitrage activity push it back. This property is the mathematical foundation for pairs trading and statistical arbitrage, as it identifies assets that share a common stochastic trend, allowing traders to profit from temporary dislocations while maintaining a market-neutral posture.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.