Statistical Arbitrage & Pairs Trading
From risk-free arbitrage to probabilistic edges: how quants exploit mean reversion, measure stretch with the z-score, and trade the relationship between two assets instead of their prices.
Arbitrage vs statistical arbitrage
Classic arbitrage is the textbook free lunch: buy an asset cheap in one place and sell it expensive in another at the same instant. If shares trade at \$100 on Exchange A and \$101 on Exchange B, you buy on A, sell on B, and lock in \$1 per share. In theory this is risk-free — both legs execute together, so the price difference is captured with no market exposure.
Statistical arbitrage ("stat arb") is the probabilistic cousin. Instead of an exact, simultaneous price gap, you bet on a statistical pattern — a price that has stretched too far from its normal level and is likely (not guaranteed) to revert. It is statistics-driven and NOT risk-free: the pattern can fail, and you can lose.
| Dimension | Pure arbitrage | Statistical arbitrage |
|---|---|---|
| Basis | Identical asset, two prices | Statistical relationship / pattern |
| Certainty | Risk-free in theory | Probabilistic — can lose |
| Edge source | Price discrepancy | Mean reversion, cointegration |
| Holding | Instantaneous | Hours to weeks (until reversion) |
It is the bread and butter of the largest quant funds: Renaissance Technologies, Two Sigma, AQR, DE Shaw and Citadel. These firms run thousands of small statistical edges at once, where no single trade is sure but the portfolio of bets is.
Mean reversion vs momentum
Mean reversion is the idea that prices tend to move back toward an average over time. When a price runs far above or below its typical level, the expectation is that it will be pulled back. This is the opposite of momentum (trend following), where a strong move is expected to continue in the same direction.
Mean reversion
Buy what is unusually low, sell what is unusually high. Bet on the snap-back.
Momentum
Buy what is rising, sell what is falling. Bet on the trend continuing.
A stretched rubber band snaps back to its resting length. Room temperature drifts back toward the thermostat setting. Your heart rate spikes during a sprint then returns to baseline. In each case there is a natural "normal" the system returns to — that is mean reversion.
Stationary vs non-stationary series
Mean reversion only works if there is a stable "normal" to revert to. That property has a name: stationarity. A stationary series oscillates around a constant mean with stable variance; a non-stationary series (a random walk) wanders with no fixed level to return to.
Mean-reverting (stationary)
Oscillates around a stable average. Deviations are temporary — the series keeps crossing its mean.
Random walk (non-stationary)
No stable mean. Each step builds on the last, so the level drifts indefinitely with no anchor.
A mean-reversion strategy needs a stable reference point to measure "too high" or "too low" against. On a random walk there is no such anchor — a price that looks extreme today can keep drifting away forever, so the same trade has no edge. Always confirm a series is stationary before trading reversion on it.
The z-score: measuring stretch
To act on mean reversion you need a number for "how far from normal" a value is. The z-score measures the distance from the mean in units of standard deviation.
where $x$ is the current value, $\mu$ the mean and $\sigma$ the standard deviation. A z-score of 0 is exactly average; ±1 is one standard deviation away; ±2 is extreme — the value has stretched well beyond its typical range.
- $z > 2$ → SELL — the price is overextended (too high), expect a fall back to the mean.
- $z < -2$ → BUY — the price is oversold (too low), expect a rise back to the mean.
- $z \approx 0$ → EXIT — the price has reverted to normal; close the position and take profit.
- A stock's price has mean $\mu = 100$ and standard deviation $\sigma = 10$. Today's price is $x = 120$.
- Apply the z-score: $z = \dfrac{120 - 100}{10}$.
- Compute: $z = \dfrac{20}{10} = 2$.
The mean-reversion pipeline
Every mean-reversion signal follows the same four steps: take a price, compare it to its mean, scale the gap by volatility into a z-score, then translate that z-score into a buy / sell / exit signal.
flowchart LR
A([Price]) --> B([Rolling Mean])
B --> C([Z-score])
C -->|z > 2| D([SELL signal])
C -->|z < -2| E([BUY signal])
C -.->|z ≈ 0| F([EXIT])
classDef s fill:#eef2ff,stroke:#4f46e5,stroke-width:1px,color:#3730a3;
classDef d fill:#ecfdf5,stroke:#0d9488,color:#0d9488;
class A,B,C s
class D,E,F d
Price → Mean → Z-score → Signal. The same pipeline drives single-asset and spread-based reversion.
Advantages
Simple, interpretable, and widely used. The z-score is a single transparent number anyone can audit.
Risks
Trend continuation (the move keeps going) and regime change (the old "normal" no longer holds).
Pairs trading: trade the relationship
Single-asset reversion is fragile — a whole sector can drift and there is nothing to anchor against. Pairs trading fixes this by trading the relationship between two related assets rather than their absolute prices. You bet that two assets which normally move together will return to their usual relationship after a temporary divergence.
Visa / Mastercard and Coke / Pepsi. These business pairs face the same customers, costs and economic forces, so their prices normally track each other. When one temporarily pulls away from the other, the gap tends to converge back — that convergence is the trade.
The mechanics: when the two diverge, you go long the cheaper asset and short the richer one. Because you are long one and short the other, broad market moves roughly cancel — the position is largely market-neutral and profits when the relationship reverts.
Correlation is not enough — cointegration
It is tempting to pick pairs by correlation, which measures how much two prices move together day to day. But correlation alone is a trap: two series can be highly correlated over the short run yet drift apart permanently, leaving no stable gap to trade.
Cointegration means two assets share a stable long-term relationship: even if each price wanders, a specific combination of them stays stationary (mean-reverting). Cointegration — not correlation — is what guarantees the spread keeps returning to its mean, which is exactly what a pairs trade needs.
Picture two dogs walking down the street on a shared leash. At any instant they can wander apart — one sniffs left, the other lunges right (that is short-term divergence). But the leash keeps pulling them back together; they can never drift apart indefinitely. The leash is cointegration: a binding long-term tie. Correlation just notices they often step in sync; cointegration is the leash that forces them back.
| Correlation | Cointegration | |
|---|---|---|
| Measures | Short-term co-movement | Long-term equilibrium tie |
| Spread behaviour | Can drift apart forever | Always pulled back to mean |
| Good for pairs? | Not sufficient alone | Yes — the property you need |
The spread and its z-score
Pairs trading turns two prices into one tradeable quantity: the spread. In its simplest form the spread is just the difference between asset $A$ and asset $B$:
In practice the two assets rarely move one-for-one, so we scale $B$ by a hedge ratio $\beta$ (its sensitivity to $A$) to get the beta-adjusted spread:
The spread itself is (for a cointegrated pair) a mean-reverting series, so we apply the exact same z-score machinery to it: compute the spread's mean and standard deviation, then its z-score. The signal mirrors single-asset reversion, but now applied to the relationship:
- $z > 2$ → SHORT the spread — $A$ is rich relative to $B$: short $A$, long $B$.
- $z < -2$ → LONG the spread — $A$ is cheap relative to $B$: long $A$, short $B$.
- $z \approx 0$ → EXIT — the spread is back to normal; close both legs.
flowchart LR
A([Spread = A − βB]) --> B([Spread Mean])
A --> C([Spread Std])
B --> D([Spread Z-score])
C --> D
D -->|z > 2| E([Short spread])
D -->|z < -2| F([Long spread])
D -.->|z ≈ 0| G([Exit / converge])
classDef s fill:#eef2ff,stroke:#4f46e5,stroke-width:1px,color:#3730a3;
classDef d fill:#ecfdf5,stroke:#0d9488,color:#0d9488;
class A,B,C,D s
class E,F,G d
The spread oscillates around its mean. Entries fire at the ±2 extremes; exits target the convergence back to zero.
- A cointegrated pair has spread mean $\mu = 5$ and standard deviation $\sigma = 2$. The current spread is $9$.
- Compute the spread's z-score: $z = \dfrac{9 - 5}{2}$.
- Evaluate: $z = \dfrac{4}{2} = 2$ — the spread is at the extreme high.
- Signal: $z > 2$ → SHORT the spread (short $A$, long $B$), expecting it to revert toward $5$.
Risk management and when pairs break
Stat arb is probabilistic, so disciplined risk control is what keeps a string of small losses from becoming one big one. Three levers matter most:
Stops
Cap each trade: if the spread keeps widening past, say, $z = 3$–$4$, cut the position rather than hope.
Limits
Position-size and per-pair limits so no single relationship can dominate the book.
Exposure
Keep legs balanced (market-neutral) and diversify across many pairs to smooth results.
A pair "breaks" when a structural change snaps the leash — a merger, new regulation, a changed business model, or a regime shift. The historical relationship no longer holds, so the spread may never revert. This is why cointegration must be monitored continuously, not assumed once and forgotten.
Pairs and stat arb are the engine of market-neutral funds: by holding offsetting long and short legs, they aim to profit from relative mispricings while staying insulated from the overall market direction.
Self-check: A mean reverting series shows a price with z-score of −2.5. What does a reversion trader do?
Self-check: Why is correlation not enough to choose a pair?
Self-check: A spread has mean 5, std 2, and currently sits at 1. What is the z-score and the action?
Key takeaways
- Arbitrage is risk-free in theory; statistical arbitrage is probabilistic and can lose.
- Mean reversion bets prices snap back to a stable average — the opposite of momentum.
- Reversion needs stationarity: a stable mean to measure "too far" against.
- The z-score $z=\frac{x-\mu}{\sigma}$ scales stretch: $z>2$ sell, $z<-2$ buy, $z\approx0$ exit.
- Pairs trading trades the spread $A-\beta B$, not raw prices — and needs cointegration, not just correlation.
- Trade relationships, not prices — with stops, limits and constant monitoring for breaks.