Quant Memo
Advanced

McDiarmid's Bounded Differences Inequality

If changing any single input to a function can only move its output by a bounded amount, McDiarmid's inequality guarantees the function's value is tightly concentrated around its average — even when the function is far more complex than a simple sum.

Prerequisites: Hoeffding's Inequality

Hoeffding's inequality tells you that a sum of independent bounded random variables concentrates tightly around its mean. But most quantities a quant actually cares about — a cross-validation error, a portfolio statistic computed from many trades, a test statistic built from a whole dataset — aren't simple sums; they're some arbitrary function of many independent inputs. McDiarmid's inequality extends the same concentration idea to any such function, as long as it satisfies one condition: changing just one of its many independent inputs, while holding all the others fixed, can never move the output by more than some bounded amount cic_i.

Pr(f(X1,,Xn)E[f]t)2exp ⁣(2t2ici2)\Pr\big(|f(X_1,\dots,X_n) - \mathbb{E}[f]| \ge t\big) \le 2\exp\!\left(\frac{-2t^2}{\sum_i c_i^2}\right)

In words: the probability that the function's value strays far from its average shrinks exponentially fast as the deviation tt grows, and the rate of that shrinkage depends only on how sensitive the function is to each individual input, not on how complicated the function otherwise is.

A concrete use: suppose a model's out-of-sample error is computed by leave-one-out cross-validation across n=1,000n = 1{,}000 independent samples, and removing any single sample can change the reported error by at most c=1/nc = 1/n. McDiarmid's inequality then guarantees this cross-validation estimate concentrates tightly around its expected value, with deviations larger than a small threshold becoming exponentially unlikely as nn grows — exactly the kind of guarantee that justifies trusting a single cross-validation run rather than re-running it many times.

McDiarmid's inequality generalizes Hoeffding's bound from sums to any function of independent inputs, as long as no single input can swing the output by more than a bounded amount — it's the workhorse result behind why complex statistics like cross-validation scores are trustworthy rather than wildly noisy.

Related concepts

Practice in interviews

Further reading

  • McDiarmid, On the Method of Bounded Differences (1989)
ShareTwitterLinkedIn