The Probability of Backtest Overfitting
Citation. David H. Bailey (Lawrence Berkeley National Laboratory, retired, and University of California, Davis), Jonathan M. Borwein (University of Newcastle), Marcos López de Prado (Guggenheim Partners, and Lawrence Berkeley National Laboratory) and Qiji Jim Zhu (Western Michigan University). "The Probability of Backtest Overfitting." Journal of Computational Finance 20(4), April 2017, pp. 39–69, first published online on 19 September 2016. doi.org/10.21314/JCF.2016.322. Preprint: SSRN 2326253, revised version of 27 February 2015. No code or data. The paper points to the Python of its example in Bailey et al. (2014), Appendix 4. The U.S. Department of Energy (contract DE-AC02-05CH11231) and the Australian Research Council funded the work.
Status. Planned. #11 implements PBO with CSCV, and #7's ledger supplies the trial matrix. No code in the repo uses PBO yet.
Read. Read on 2026-11-27 from the authors' PDF of the 27 February 2015 revision (davidhbailey.com), 34 pages. I extracted the whole text with pdftotext and read it in the source's own words. SSRN refused the fetch, and the journal version is behind a login. The journal's volume, pages and dates come from the publisher's page, which a subagent read. I saw none of the 13 figures, only their captions and the text about them. I did not read the companion study of CSCV's accuracy (SSRN 2568435).
Summary
Claim. The probability that a strategy selection overfits can be estimated from the trials' returns alone, with no model of the strategy. Combinatorially symmetric cross-validation (CSCV) gives "reasonable estimates" of this probability.
Method.
- The definition. A selection overfits when the configuration that is best in sample ranks below the median out of sample. PBO is the probability of that event (Definition 2.2).
- The data. M is a T × N matrix of returns, one column for each of the N trials. Its rows must be synchronous across the trials.
- CSCV. Split M by rows into S equal blocks, with S even. For each of the C(S, S/2) ways to choose S/2 blocks, the chosen blocks are the training set and the rest are the test set. Find the best trial in the training set. Take its relative rank ω̄ = r̄ / (N + 1) in the test set, and the logit λ = ln(ω̄ / (1 − ω̄)). PBO is the share of logits at or below zero.
- Three other outputs. Performance degradation regresses the test Sharpe ratio of the selected trial on its training Sharpe ratio. Probability of loss is the share of combinations where the selected trial loses out of sample. Stochastic dominance asks whether the selected trials' test results dominate those of all the trials, to first or second order.
- The parameters. S = 16 is the authors' default. N must be much larger than 10 for the logits to take enough values. T should be twice the sample that the investor used to choose the configuration.
- The examples. A monthly rule with four parameters (entry day, holding period, stop loss and side) gives a mesh of 8,800 configurations. The authors run it on 1,000 daily prices from a random walk. They then run it on a random walk whose first five returns of each month have a mean of a quarter of a standard deviation.
Findings, as the source reports them.
| Setting | Number | Value |
|---|---|---|
| Example 1: random walk, 8,800 configurations, best in sample | annualised Sharpe ratio | 1.27 |
| The same | PSR statistic | 2.83 |
| The same, CSCV | test Sharpe ratios below zero | about 53% |
| The same, CSCV | PBO | 55% |
| Example 2: random walk with a monthly effect, best in sample | annualised Sharpe ratio | 1.54 |
| The same, CSCV | test Sharpe ratios below zero | 13% |
| The same, CSCV | PBO | 13% |
| Figure 2, a strategy the paper does not describe | test Sharpe ratios below zero | about 78% |
| The same | PBO | 74% |
| Figure 3, "a real investment strategy" | probability of loss out of sample | about 3% |
| The same | PBO | "4%" in one sentence, "0.04%" in the next |
| S = 24, S = 12 | number of logits | 2,704,156 and 924 |
Where the claims go beyond the evidence
The paper does not show its accuracy. The conclusions say that Monte Carlo and extreme-value checks give "relatively small errors". Those checks are in another paper (SSRN 2568435), and this one reports no number from them.
One synthetic test of each kind. The evidence is one random walk and one planted effect, each one path of 1,000 days. No repeated draws give the spread of PBO, or its false-positive rate under the null.
The 0.05 threshold has no calibration. The paper calls rejecting at PBO > 0.05 "a customary approach". Example 2 has a real edge and gives a PBO of 13%, so this rule would reject it.
The error bound treats the logits as independent. The bound σ < 0.0045 for S = 16 uses the variance of a proportion from independent draws. The combinations share most of their blocks, so the logits are strongly dependent and the true error is larger.
Errors in the text. C(16, 8) is 12,870, not the "12,780" given twice. Figure 3's PBO is "4%" and then "0.04%". Example 1's Sharpe ratio is 1.27, and later "1.3". Step c of the algorithm calls the training set "the testing set". The conclusions define PBO against the "mean" out of sample, and Definition 2.2 uses the median.
"Real" examples without data. Figures 2 and 3 come from strategies the paper does not name or describe, so no one can reproduce them.
Credit. Section 5 states real limits. A high PBO can come from many trials with equal skill. CSCV can't find a flawed backtest, such as wrong costs or look-ahead. Hidden trials bias PBO down. A structural break outside the sample is invisible. And PBO used as an objective for the search is "a gross misuse".
Use in this repo
The repo has no overfitting code yet. #11 will implement PBO with CSCV, and #87's harness will report it with the deflated Sharpe ratio (docs/literature/deflated-sharpe-ratio.md). The two measure different things. DSR asks whether the best Sharpe ratio beats luck, and PBO asks whether the selection carries out of sample.
The ledger must keep returns, not only scores. CSCV needs each trial's full return series on a common index. #7's ledger must store the series of every trial, including the rejected ones. The DSR review asks for the same data. Strategies at different frequencies need one shared index before they enter M.
The paper's two examples are ready tests. Example 1 (a random walk) should give a high PBO, and Example 2 (a planted monthly effect) a low one. These fit RQ1's Phase 2, which calibrates the evaluator on synthetic strategies with an edge or none (#5). Repeated draws of each would measure what the paper does not: the spread and the error rates of PBO.
The evaluator can become the target. The authors warn against PBO as an objective. In this repo, agents may revise a strategy until the harness passes it. Each such revision is a trial, so the ledger must count runs of the harness too.
PBO judges a family, not one strategy. A registry strategy with a single configuration has no PBO. The harness needs a family of trials for each strategy, which #7 groups.
Follow-up. #91 reviews the companion study of CSCV's accuracy, which this paper's claims rest on.
Questions for the maintainer. What PBO does the verdict (#12) accept? The paper's 0.05 would reject its own planted edge (13%). And which S does the harness use for daily, hourly and event-driven data?