Inferensys

Glossary

Cointegration

A statistical property of non-stationary time series where a linear combination is stationary, indicating a stable, long-run equilibrium relationship used in pairs trading.
Elegant overhead shot of a polished wooden communal table in a sun-drenched WeWork lounge, laptops and tablets displaying AI workflow dashboards, plants and pendant lights in background.
LONG-RUN EQUILIBRIUM

What is Cointegration?

Cointegration is a statistical property of a multivariate time series where a linear combination of individually non-stationary variables is stationary, revealing a stable, long-run equilibrium relationship.

Cointegration is a statistical property of a set of non-stationary time series variables where a specific linear combination of them is stationary. This indicates that the variables share a common stochastic drift and cannot wander arbitrarily far apart over time, defining a long-run equilibrium relationship. Unlike simple correlation, cointegration implies a structural, mean-reverting connection that is foundational for pairs trading and statistical arbitrage strategies.

Formally, if two price series are integrated of order one, I(1), but their spread is I(0), they are cointegrated. The Engle-Granger two-step method and the Johansen test are standard procedures for testing this property. In algorithmic trading, a cointegrating vector defines the hedge ratio for constructing a mean-reverting portfolio, allowing a system to short the overperforming asset and go long the underperforming one, profiting from the temporary deviation's correction back to equilibrium.

LONG-RUN EQUILIBRIUM

Key Characteristics of Cointegration

Cointegration is a statistical property of a set of non-stationary time series variables where a linear combination of them is stationary, indicating a stable, long-run equilibrium relationship.

01

Non-Stationary Components

Cointegration requires that each individual time series is integrated of order one, denoted as I(1). This means the series itself is non-stationary (possessing a unit root) and its variance and mean change over time, but its first difference is stationary. Common examples include asset prices, GDP, and interest rates. A stationary I(0) series cannot be cointegrated with another I(0) series in the traditional sense; cointegration specifically addresses the shared stochastic trends in non-stationary data.

02

Stationary Linear Combination

The defining feature is the existence of a cointegrating vector that, when applied to the I(1) variables, produces a new series that is I(0) or stationary. This stationary residual represents the long-run equilibrium error. For example, if two stock prices are cointegrated, their price spread will be mean-reverting, fluctuating around a constant mean. This stationary combination implies that the variables cannot drift arbitrarily far apart over the long term.

03

Shared Stochastic Trends

Cointegrated variables share one or more common stochastic trends. If a system of n variables has r cointegrating relationships, it has n - r independent stochastic trends driving its non-stationary behavior. This is a key insight from the Granger Representation Theorem, which states that a cointegrated system can be represented as a Vector Error Correction Model (VECM). The shared trends explain why the variables move together over time.

04

Error Correction Mechanism

Cointegration implies an error correction mechanism (ECM). This means that any short-term deviation from the long-run equilibrium will be corrected over time. The dynamics are modeled by a VECM, where the change in a variable depends on the lagged equilibrium error (the deviation) and past changes of all variables. This captures both the long-run equilibrium relationship and the short-run dynamic adjustments back toward it.

05

Engle-Granger Two-Step Method

A classic approach for testing cointegration between two variables. The first step is to estimate the long-run equilibrium relationship using ordinary least squares (OLS). The second step tests the residuals from this regression for a unit root using an Augmented Dickey-Fuller (ADF) test. If the residuals are stationary, the series are cointegrated. This method is straightforward but assumes a single cointegrating vector and is sensitive to the choice of dependent variable.

06

Johansen Test for Multiple Variables

A multivariate framework for testing cointegration among more than two variables. The Johansen test uses a Vector Autoregression (VAR) model and applies maximum likelihood estimation to determine the number of cointegrating relationships (r). It provides two test statistics: the trace test and the maximum eigenvalue test. Unlike the Engle-Granger method, it can identify multiple cointegrating vectors and treats all variables as endogenous.

COINTEGRATION CLARIFIED

Frequently Asked Questions

Concise, technically precise answers to the most common questions about cointegration, its mechanics, and its application in quantitative finance.

Cointegration is a statistical property of a set of non-stationary time series variables where a specific linear combination of them is stationary, indicating a stable, long-run equilibrium relationship. It works by identifying a cointegrating vector that cancels out the shared stochastic trends driving the individual series. For example, if two stock prices are both non-stationary I(1) processes, but their spread (e.g., StockA - 0.8*StockB) is stationary I(0), they are cointegrated. This implies that while the prices can wander randomly, they cannot drift arbitrarily far apart; an error-correction mechanism pulls them back toward the equilibrium. The Engle-Granger two-step method tests for this by first regressing one variable on another and then testing the residuals for a unit root using an Augmented Dickey-Fuller (ADF) test.

STATISTICAL RELATIONSHIP COMPARISON

Cointegration vs. Correlation

Distinguishing between short-term co-movement and long-run equilibrium in financial time series

FeatureCointegrationCorrelationSpurious Regression

Definition

A linear combination of non-stationary series that is stationary

A scaled measure of linear co-movement between two stationary variables

A statistically significant relationship between independent non-stationary series with no economic link

Stationarity Requirement

Requires non-stationary I(1) inputs

Requires stationary I(0) inputs

Occurs when non-stationary series are regressed directly

Time Horizon

Long-run equilibrium relationship

Short-term contemporaneous co-movement

No genuine temporal relationship

Mathematical Basis

Residuals from linear combination are mean-reverting

Covariance normalized by standard deviations

High R-squared driven by shared stochastic trends

Mean Reversion

Persistence

Relationship persists over time

Unstable; can change sign rapidly

Disappears when differencing is applied

Trading Application

Pairs trading and statistical arbitrage

Portfolio diversification and hedging

None; leads to false strategy signals

Test Statistic

Engle-Granger tau or Johansen trace statistic

Pearson or Spearman coefficient

Durbin-Watson statistic approaching zero

COINTEGRATION IN PRACTICE

Real-World Applications in Trading

Cointegration forms the statistical backbone of mean-reversion strategies, enabling traders to identify and profit from temporary price divergences between assets that share a long-run equilibrium relationship.

01

Pairs Trading Strategy

The canonical application of cointegration. A trader identifies two cointegrated assets, such as Coca-Cola (KO) and PepsiCo (PEP) , and monitors the spread between their prices.

  • When the spread widens beyond a historical threshold (e.g., 2 standard deviations), the strategy shorts the outperformer and goes long the underperformer.
  • The position is closed when the spread reverts to its mean, capturing the convergence profit.
  • This is a market-neutral strategy, as the long and short legs hedge broad market risk.
Market Neutral
Risk Profile
02

Statistical Arbitrage (Stat Arb)

A generalized form of pairs trading applied to a large basket of securities. Instead of two assets, a synthetic asset is constructed from a portfolio of stocks that is cointegrated with a target asset or index.

  • Principal Component Analysis (PCA) or the Johansen test is used to identify cointegrating vectors across hundreds of assets.
  • The residual of the cointegrating regression is the trading signal. A mean-reverting residual triggers a trade.
  • High-frequency execution is critical, as these arbitrage opportunities often exist for milliseconds.
100s
Assets in Basket
03

Index Arbitrage & ETF Creation/Redemption

The relationship between an Exchange-Traded Fund (ETF) and its underlying basket of stocks is inherently cointegrated. Authorized Participants (APs) exploit this.

  • If the ETF price deviates from its Net Asset Value (NAV), an AP will simultaneously buy the cheaper asset and sell the richer one.
  • For a premium, the AP buys the underlying basket and redeems it for new ETF shares to sell. For a discount, the process is reversed.
  • This mechanism, driven by cointegration, keeps ETF prices tightly aligned with their NAV.
Basis Points
Typical Deviation
04

Long-Short Equity Hedge Funds

Many fundamental and quantitative hedge funds use cointegration to build dollar-neutral portfolios that are insulated from broad market moves.

  • A fund might identify a cointegrated cluster of airline stocks. They go long the stocks with the most positive residual (undervalued) and short those with the most negative residual (overvalued).
  • The portfolio's beta to the overall market is engineered to be near zero.
  • Profit is generated purely from the idiosyncratic convergence of the stocks within the cluster, not from directional market exposure.
~0.0
Target Portfolio Beta
05

Cross-Market Commodity Trading

Cointegration is used to trade economic relationships between different commodities or their processing chain, known as crack spreads (oil to gasoline) or crush spreads (soybeans to meal and oil).

  • For example, a trader models the cointegration between West Texas Intermediate (WTI) and Brent crude oil benchmarks.
  • A temporary dislocation in the transatlantic spread, driven by a geopolitical event or pipeline disruption, triggers a mean-reversion trade.
  • The trader goes long the temporarily cheap benchmark and short the expensive one, betting on the restoration of the historical equilibrium.
WTI-Brent
Classic Spread
06

Triangular Arbitrage in FX

In foreign exchange, three currency pairs that share a common base and quote currency form a cointegrated system. Any deviation from the synthetic cross-rate is an arbitrage opportunity.

  • Example: EUR/USD, USD/JPY, and EUR/JPY. The price of EUR/JPY must equal the product of the other two.
  • Algorithmic traders monitor this relationship tick-by-tick. If a lag in one pair causes a mispricing, simultaneous trades lock in a risk-free profit.
  • This enforces the no-arbitrage condition and keeps global FX markets consistent.
< 1 ms
Execution Window
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.