p-values and Multiple Testing
What a p-value is and the five things it is not, why testing thousands of signals guarantees false discoveries, and the Bonferroni and Benjamini–Hochberg corrections that keep a backtesting pipeline honest.
Prerequisites: Hypothesis Testing, Confidence Intervals
The p-value is the most used and most abused number in quantitative research. Used correctly it calibrates the surprise in a single test; used as most people use it, as "the probability the strategy is real", it is nonsense. And in a world where you can backtest ten thousand signals before lunch, the deeper problem is not any single p-value but the fact that testing many of them guarantees false discoveries. This concept is where careful statistics most directly protects (or destroys) trading capital.
What a p-value is
Fix a test statistic with a known distribution under the null . The p-value is the probability, computed under , of observing a statistic at least as extreme as the one you got:
A useful fact: if is true and the test is continuous, the p-value is uniformly distributed on . That is the entire basis of the framework, under the null, a p-value below 0.05 happens exactly 5% of the time, which is why rejecting when controls the type I error at .
The five things a p-value is not
Small p-values feel like probabilities about hypotheses; they are not.
- It is not , that is a posterior probability and needs a prior (see Bayesian Inference).
- It is not the probability the result was due to chance.
- is not the probability the alternative is true, nor the probability the finding will replicate.
- A small does not measure effect size, with enough data a trivially small edge gets a tiny p-value. Report the confidence interval to see magnitude.
- does not prove the null; absence of evidence is not evidence of absence, especially given how underpowered financial tests are.
Why multiple testing breaks everything
Here is the mechanism that ruins naive backtesting. Suppose you test strategies that are all worthless (every null true), each at level , with independent tests. The probability that at least one clears the bar by luck is the family-wise error rate:
For this is ; for it is . Test a hundred junk signals and you are all but guaranteed several "significant" ones. Expected false discoveries grows linearly: signals yields spurious "edges" at . This is not a subtle bias; it is the dominant reason published anomalies and dazzling backtests fail out of sample.
Bonferroni: control the family-wise error rate
The simplest fix: to hold the probability of any false discovery at , test each hypothesis at . By the union bound (Boole's inequality),
so Bonferroni controls FWER with no independence assumption. Its cost is brutal conservatism: with you need , decimating power and rejecting almost every real-but-modest edge. It answers "am I sure none of my discoveries is false," which is often stricter than a researcher actually needs.
Benjamini–Hochberg: control the false discovery rate
The more useful target in research is the false discovery rate, the expected fraction of your rejections that are false, where is the number rejected and the number falsely rejected. Controlling FDR at 10% says "I accept that about 10% of the signals I greenlight are junk," a rational research budget. The Benjamini–Hochberg procedure: sort the p-values ascending , find the largest with
and reject . This controls FDR at under independence (and positive dependence). It is far more powerful than Bonferroni because the threshold adapts, when many effects are real, the bar relaxes; when nothing is real, it collapses to roughly Bonferroni. For a research pipeline scanning thousands of features, BH is the standard tool.
Worked example: 200 candidate factors
You test 200 candidate factors for return predictability at . Naively you expect false positives among truly useless factors. Suppose 30 factors cross . Bonferroni demands ; maybe 3 survive, you are confident in those but have thrown away every genuine weak factor. BH at FDR 10%: sort the 30 significant p-values, find the largest with ; perhaps 12 survive, of which about 1 is expected to be false. The BH set is the sane middle ground, this is precisely the discipline Harvey, Liu & Zhu argue the asset-pricing literature failed to apply, leaving a "factor zoo" of anomalies that do not replicate.
Failure modes in financial data
- Hidden multiplicity. The that matters is the number of things you tried, including informal ones, every parameter you tuned, every universe you sliced, every lookback you swept. Reported is almost always an undercount, so even BH under-corrects.
- Dependence. Strategy tests are highly correlated (overlapping signals, common market beta), so the independence assumption behind FWER math is violated; Bonferroni stays valid (union bound needs no independence) but is even more conservative, while plain BH may need the Benjamini–Yekutieli variant.
- The garden of forking paths. Sequential, data-dependent choices inflate error rates in ways no post-hoc correction fully captures, the cure is out-of-sample and true hold-out testing, not a bigger denominator. See Overfitting and Walk-Forward Analysis.
- Publication/selection bias. You only see the backtests that worked; the denominator of attempts is invisible, so reported Sharpes are order-statistics maxima, not typical draws.
In interviews
Nail the definition, a p-value is the probability of data this extreme assuming the null is true, and be ready to reject the common misreadings (it is not the probability the null is true, not one minus the replication probability, not an effect size). The multiple-testing question is a favorite for quant research roles: derive , explain that testing 20 signals gives you a ~64% chance of a false positive, and contrast Bonferroni (controls FWER, conservative, threshold ) with Benjamini–Hochberg (controls FDR, adaptive, more powerful). The strongest close is connecting it to backtesting: the reason so many strategies die out of sample is uncorrected multiplicity, and the defense is FDR control plus genuine hold-out data.
Related concepts
Practice in interviews
Further reading
- Benjamini & Hochberg (1995), Controlling the False Discovery Rate
- Harvey, Liu & Zhu (2016), …and the Cross-Section of Expected Returns
- Wasserman, All of Statistics (Ch. 10)