Backtest Overfitting in the Machine Learning Era
Citation. Hamid Arian (York University), Daniel Norouzi Mobarekeh (Sharif University of Technology) and Luis Seco (University of Toronto). "Backtest Overfitting in the Machine Learning Era: A Comparison of Out-of-Sample Testing Methods in a Synthetic Controlled Environment." Knowledge-Based Systems 305, December 2024, article 112477. doi.org/10.1016/j.knosys.[removed]. Preprints: SSRN 4686376, January 2024, and SSRN 4778909, March 2024. The paper says its code is on github.com/RiskLabAI, with notes at risklab.ai/backtesting. It has no data release and gives no funding.
Status. Planned. #10 implements walk-forward, purged and embargoed k-fold and CPCV, and #31 (RQ4) studies the purge and embargo lengths. No code in the repo uses them yet.
Read. Read on 2026-11-27 from the PDF of SSRN 4686376, which the maintainer supplied, 26 pages. It is the January 2024 preprint, not the journal version, and I couldn't read the journal version. A subagent extracted the whole text with pdftotext. It read Tables 1 to 3 and 5 to 10 and Figures 5, 13, 14 and 16 as page images. I checked pages 23 and 24 (Tables 5 to 9) and the quoted passages myself. Nobody looked at Figures 1 and 7 to 10 beyond their captions. Medians read from the box plots are approximate.
Summary
Claim. Of four out-of-sample methods, combinatorial purged cross-validation (CPCV) best guards against backtest overfitting. It gives a lower probability of backtest overfitting (PBO) and a better deflated Sharpe ratio (DSR) statistic. Walk-forward is the worst, with more variance over time and less stationarity.
Method.
- The market. A synthetic price model with three regimes: calm, volatile and a speculative bubble. Each regime is a Heston model with Merton jumps, and the bubble adds a drift burst. Parameters come from published fits to the S&P 500. There are 1,000 paths of 40 years of daily prices, each with its own seed.
- The strategy. A moving-average crossover gives the side. A meta-labelling classifier on 22 features gives the size, with triple-barrier labels.
- The trials. 28: four window pairs, each with k-NN (3 settings), a decision tree (1) and XGBoost (3). The authors chose settings that "heighten the potential for overfitting", such as an XGBoost learning rate of 100.
- The methods. K-fold, walk-forward and purged k-fold, each with 4 splits, and CPCV with 8 groups and 2 test groups. Purged k-fold and CPCV use an embargo of 2%. Where CPCV predicts a label in several paths, the paper averages the predicted probabilities.
- The metrics. PBO from CSCV with 16 partitions over the 28 trials. The DSR statistic of the best trial, before the normal CDF. Both for the full 40 years and for each year, with the yearly series summarised by σ²/µ² (the "Efficiency Ratio") and by an ADF test.
- The tests. Kruskal–Wallis across the four methods, then Dunn's test with Bonferroni correction.
Findings, as the source reports them.
| Setting | Number | Value |
|---|---|---|
| All paths and methods | correlation of PBO with the best trial's DSR statistic | −0.03 |
| Full period, walk-forward | median PBO | 0.451437 |
| The same, all four methods (Table 5) | Kruskal–Wallis p, η² | 7.05e-09, 0.01022 |
| The same, CPCV against k-fold, purged k-fold and walk-forward | Dunn p | 4.20e-06, 3.32e-07, 1.09e-06 |
| The same, each pair of the other three methods | Dunn p | 1.0 |
| Full period, walk-forward | median DSR statistic | 0.160818 |
| The same, all four methods (Table 6) | Kruskal–Wallis p, η² | 5.0367e-15, 0.0174 |
| The same, CPCV against k-fold and purged k-fold | Dunn p | 1.0, 1.0 |
| Yearly PBO, walk-forward | median Efficiency Ratio | 0.224821 |
| Yearly DSR statistic: CPCV, k-fold, purged k-fold | median Efficiency Ratio | 34.30, 84.36, 82.59 |
| Yearly PBO and DSR statistic, walk-forward | median ADF statistic | −2.41 and −3.86 |
| Yearly PBO, all four methods (Table 9) | Kruskal–Wallis η² | 0.55106 |
From the box plots (Figure 13), the median PBO is about 0.38 for CPCV and about 0.44 to 0.45 for the other three. Every method's PBO spans about 0 to 0.95.
Where the claims go beyond the evidence
CPCV's lead rests on PBO alone, and it is small. On the DSR statistic, CPCV doesn't differ from k-fold or purged k-fold (Dunn p = 1.0). On PBO, the method explains about 1% of the variance (η² = 0.01022). The abstract and the conclusion still claim CPCV wins on both.
CPCV averages its paths. The paper averages CPCV's predictions over its paths, so its signal is an ensemble. The other methods give one prediction for each label. The averaging alone could lower PBO, and the paper doesn't separate its effect from the splitting.
Walk-forward has less test data. With 4 splits, walk-forward makes no prediction for its first training window. A shorter series lowers the DSR statistic and leaves early years empty in the yearly series. The paper doesn't discuss this, and it fills the gaps with the mean before its PCA.
No ground truth. The environment is "controlled", but no trial has a known edge and none is a null. So the study can't say whether PBO or DSR flagged the right trials. It also has no test on real prices, and the S&P 500 enters only through the model's parameters.
One setting of everything. One price model, one strategy family, 28 trials and one setting of each method. The paper reports no sensitivity to the number of splits, the embargo or the CSCV partitions, although it says walk-forward needs "sensitivity analysis".
Tests for independent groups on paired data. The four methods run on the same 1,000 paths, so each path gives a pair of results. Kruskal–Wallis and Dunn's test treat them as independent. A paired test, such as Friedman's, fits the design. The paper applies Bonferroni within each Dunn table, but not across its six families of tests.
Errors in the text.
- Table 8 repeats Table 7's six Dunn p-values exactly, for a different statistic.
- The text says k-fold and walk-forward "showed no significant difference" at p = 2.15 × 10⁻⁵⁴, and Table 8 marks the pair significant.
- The paper gives the number of CPCV paths as C(N, k), which is 28 here. López de Prado's count is (k/N) C(N, k), which is 7.
- Table 3 lets the bubble regime move to the volatile one. The simulated transitions in Figure 5 show no such move, because the bubble has a fixed length and ends in the calm regime.
- The text says the volatile regime's tails diverge "more noticeably". But Table 4 gives it the lowest excess kurtosis (0.25, against 3.49 for the calm regime).
- Table 6 prints "3.21-09" for a p-value. The text gives η² values that differ from the tables, such as 0.017 against 0.0174.
Credit. The authors state that synthetic data "might not fully capture" real markets, and that their results need "further empirical validation". They publish their code. They avoid look-ahead in the bet size by shifting it one day.
Use in this repo
#10 should treat CPCV's advantage as unproven. The evidence for CPCV over purged k-fold is one PBO comparison with η² = 0.01. The evidence against plain walk-forward is stronger, but walk-forward's shorter test series may explain part of it. #10 can still build all four methods, because each answers a different question.
Count the CPCV paths correctly. #10 should use López de Prado's φ = (k/N) C(N, k) paths, and keep each path's returns apart. Averaging the paths gives one ensemble series, which is a different strategy from any one path. PBO (docs/literature/probability-of-backtest-overfitting.md) and DSR (docs/literature/deflated-sharpe-ratio.md) then need the paths, not the average.
The paper's environment fits RQ1's Phase 2. Phase 2 (#5) calibrates the evaluator on synthetic strategies. Some have a known edge and some have none. The regime-switching Heston model is a reasonable generator. The repo must add what the paper lacks: trials with a planted edge, and a null. Repeated draws then measure the error rates of each splitter.
The purge and embargo need a study. The paper fixes the embargo at 2% and never varies it. That is the question of RQ4 (#31), for each horizon from quarterly to hourly.
Compare methods on paired samples. When the repo compares splitters on the same paths, it should use paired tests, and report effect sizes with intervals, not only p-values.
PBO and DSR measure different things. Their correlation here is −0.03. The PBO review makes the same point: the harness (#87) should report both, not one in place of the other.
A question for the maintainer. Does the verdict (#12) use one splitter for every strategy, or does it choose the splitter by horizon and market?