Large Deviations and Cramér's Theorem
When a rare event happens anyway — a portfolio far from its mean, a queue that never clears — large deviations theory tells you it isn't just "unlikely," it's unlikely at a precise, computable exponential rate.
Prerequisites: Chernoff Bounds, Moment Generating Functions
The Law of Large Numbers says a sample average converges to the true mean. That's reassuring, but a risk manager needs more: not just "the average settles down," but how rare is it, precisely, for the average to sit far from where it should be after trials? "Very rare" isn't a number you can size capital against. Cramér's theorem gives the exact exponential rate at which that rareness decays — turning a vague intuition into a formula.
The analogy: the odds of an unlikely streak
If a coin is fair, seeing 60% heads in 10 flips is mildly surprising. Seeing 60% heads in 10,000 flips would be almost unbelievable — not just "more surprising," but surprising by an amount that compounds. Large deviations theory quantifies exactly how that improbability compounds: the probability of the sample average sitting at some wrong level instead of the true mean shrinks like , where is a fixed "cost per observation" of drifting to . Double the sample size, and you don't double the improbability — you square it.
Writing it down
Let be i.i.d. with mean , and let . Cramér's theorem says that for ,
where , the rate function, is defined as the Legendre transform of the log-MGF:
In words: the probability of the sample average landing near some off-target value behaves like for large , and — a single number per , always and equal to zero exactly at — is computed by the same optimize-over- trick used in Chernoff bounds. In fact Cramér's theorem is the exact asymptotic version of what Chernoff bounds only bound from above: is the tightest possible exponential rate, not just an upper bound on it.
Near the mean, behaves roughly like a parabola — this plot's shape is a stand-in for that local behavior; the further sits from , the steeper climbs and the more astronomically rare that deviation becomes.
Worked example 1: fair coin, rate function
For Bernoulli(), the rate function works out to the binary relative entropy:
At : . So . At : — plausible. At : — utterly impossible in practice. The same 10-percentage-point gap from the mean goes from "happens sometimes" to "will never happen" purely because grew, exactly the compounding the streak analogy described.
Watch the running average tighten around the truth as grows — large deviations theory is the precise statement of how fast the probability of it sitting away from that band collapses, exponentially in rather than merely shrinking.
Worked example 2: sizing a "never happens" loss
A market maker's daily P&L is the sum of 200 independent trades, each with mean edge \mu = \5\pm$50I(x)\bar{x}=-$5per trade (i.e., total daily P&L around-$1{,}000+$1{,}000I \approx 0.05P(\text{daily P&L} \approx -$1{,}000) \approx e^{-0.05 \times 200} = e^{-10} \approx 4.5\times10^{-5}$ — roughly a 1-in-22,000 event, i.e. expect to see it about once every 85 years of trading days. That number is exactly the kind of figure a capital or limits committee needs, and it came from one estimated rate function, not from guessing "should be rare."
What this means in practice
- Setting risk limits. The rate function converts "how many standard deviations away" (a normal-distribution habit) into an honest, distribution-specific exponential probability — useful precisely when P&L isn't normal.
- Queueing and execution. The same machinery bounds the probability that an order queue or inventory position drifts far from target, informing how much buffer capital or inventory a market maker needs to hold.
- Insurance and ruin. Large deviations theory underlies ruin probability estimates: how unlikely is it that cumulative losses exceed reserves before some horizon.
Cramér's theorem says the probability a sample average lands away from its true mean decays like , where the rate function is the same Legendre-transform optimization that produces Chernoff bounds — but exact, not just an upper bound.
Large deviations results are asymptotic in — the formula is a limit, and for small or moderate the actual probability can differ from the exponential approximation by a large multiplicative (polynomial) factor. Treating as exact for, say, trades is a common overreach; it's a guide to the rate of decay, not a precise probability at small sample sizes.
Related concepts
Practice in interviews
Further reading
- Dembo, Zeitouni, Large Deviations Techniques and Applications (ch. 2)
- Mitzenmacher, Upfal, Probability and Computing (ch. 4)