Quant Memo
Core

Wilson and Clopper-Pearson Intervals

Two better ways to build a confidence interval around a win rate or hit ratio than the textbook normal approximation, which badly misbehaves with small samples or extreme probabilities.

Prerequisites: The Bernoulli Distribution

Imagine backtesting a signal that fired 20 times and was right 18 of them — a 90% hit rate. Do you actually believe the true win probability is close to 90%, or could it plausibly be 70%? The textbook "normal approximation" interval, p^±1.96p^(1p^)/n\hat p \pm 1.96\sqrt{\hat p(1-\hat p)/n}, is known to behave badly exactly here: with a small sample and a proportion near 0 or 1, it can produce an interval that overshoots 100% or undershoots 0%, which is nonsense for a probability.

The Wilson interval fixes this by solving the interval directly from the underlying test statistic rather than plugging p^\hat p into a simple formula, which keeps it inside [0,1][0,1] and gives much better coverage at small nn. The Clopper-Pearson interval goes further, inverting the exact binomial distribution rather than any normal approximation at all — it's "exact" in the sense of guaranteeing at least the stated confidence level, though this makes it somewhat wider (more conservative) than Wilson in practice.

For the 18/20 example: the naive normal interval gives roughly [76%,104%][76\%, 104\%] — already broken, since it exceeds 100%. The Wilson interval instead gives approximately [68%,97%][68\%, 97\%], a sensible, bounded range. Clopper-Pearson gives a similar but slightly wider [66%,98%][66\%, 98\%], reflecting its more conservative guarantee.

Never use the plain normal-approximation interval for a win rate or hit ratio from a small sample or an extreme proportion — it can produce nonsensical bounds outside [0,1][0,1]. Use Wilson as the practical default and Clopper-Pearson when you need a guaranteed-conservative bound.

Related concepts

Practice in interviews

Further reading

  • Brown, Cai & DasGupta, Interval Estimation for a Binomial Proportion
ShareTwitterLinkedIn