A Reality Check for Data Snooping, and A Test for Superior Predictive Ability
Citation. Two papers on one page, because the second refines the first.
- Halbert White (University of California, San Diego, and QuantMetrics R&D Associates). "A Reality Check for Data Snooping." Econometrica 68(5), September 2000, pp. 1097–1126. doi.org/10.1111/1468-0262.00152. Received June 1997, final revision July 1999. NeuralNet R&D Associates and QuantMetrics R&D Associates funded it. The paper states that "computer implementations of the methods … are covered by U.S. Patent 5,893,069". I did not check the patent's status.
- Peter Reinhard Hansen (Stanford University). "A Test for Superior Predictive Ability." Journal of Business & Economic Statistics 23(4), 2005. doi.org/10.1198/073500105000000063. Preprint: SSRN 264569, version of April 2005. The Danish Research Agency funded it (grant 24-00-0363). Neither paper releases code. Hansen's simulations ran in Ox 3.30.
Status. Planned. #11 implements Hansen's SPA test against buy-and-hold and 1/N. No code in the repo uses either test yet.
Read. Read on 2026-11-27. White: the journal PDF, from a course page at the University of Wisconsin, 30 pages, extracted with pdftotext. I read Sections 1 to 5 and Tables I and II in the source's own words, and skimmed the mathematical appendix. Some symbols came through garbled, and I saw none of the figures. Hansen: the April 2005 PDF, 42 pages, which the maintainer supplied after both open copies failed. I read all of it, with Tables 2 to 6 and Figures 1 to 4. I recomputed Hansen's Figure 1 powers and his sample-size comparison.
Summary
Claim. White: a test can compare the best of l models from a search with a benchmark. Its bootstrap p-value accounts for the whole search. Hansen: White's test loses power when the search includes poor models. Studentising each model's statistic, and recentring the null on the data, fixes most of this.
Method.
- The null, in both papers. For each model k, d_k,t is its performance minus the benchmark's, such as the log-return difference of a trading rule. The null is that no model beats the benchmark in expectation, max_k E(d_k) ≤ 0.
- White's Reality Check (RC). The statistic is V = max_k √n · d̄_k. The p-value comes from the stationary bootstrap of Politis and Romano, with V* = max_k √n · (d̄*_k − d̄_k). This assumes every model is exactly as good as the benchmark, the least favourable configuration (LFC). The search can run model by model, and needs only the running maximum and the bootstrap indexes. Section 2.c extends it to functions of averages, such as the Sharpe ratio.
- Hansen's SPA test. It studentises the statistic: T = max(max_k √n · d̄_k / ω̂_k, 0). In the bootstrap, it recentres each model on 0 unless that model is clearly worse than the benchmark: √n · d̄_k / ω̂_k ≤ −√(2 log log n). This gives a consistent p-value (SPA_c), between a liberal (SPA_l) and the conservative LFC bound (SPA_u). ω̂_k uses the stationary bootstrap's kernel directly, not resampling.
- The experiments. White applies RC to 3,654 linear models of next-day S&P 500 returns, each with three of 29 technical indicators. That is 758 forecast days, June 1991 to May 1994, with N = 500 resamples and q = 0.5. Hansen simulates IID Normal losses with m = 100 or 1,000 models and n = 200 or 1,000, using 10,000 samples. He also tests 3,304 regression forecasts of US annual inflation against a random walk, over 160 quarters.
Findings, as the sources report them.
| Source and setting | Number | Value |
|---|---|---|
| White, Table I: best of 3,654 models by MSE | RC p-value, and naive p-value | .3674 and .1068 |
| White, Table II: best by directional accuracy, 54.75% against 50.79% | RC p-value, and naive p-value | .2040 and .0036 |
| Hansen, Example 4: m = 2, one noisy model, 5% level | power of RC, and of the studentised test | about 15% and about 53% |
| Hansen, Table 2: m = 100, n = 200, all models binding (Λ₀ = Λ₁ = 0) | size of RC_u and SPA_c at 5% | 0.053 and 0.060 |
| Hansen, Table 3: the same, n = 1,000 | size of RC_u and SPA_c at 5% | 0.048 and 0.048 |
| Hansen, Table 2, Panel E: (Λ₀, Λ₁) = (10, −3) | power of RC_u and SPA_c at 5% | 0.006 and 0.843 |
| Hansen, Figure 4 design (m = 100, Λ₀ = 20): 50% power | equivalent data lost by RC instead of SPA_c | about 84% |
| Hansen, Table 6: inflation, Large Universe (m = 3,304) | SPA_c and RC_u p-values | 0.741 and 0.978 |
| Hansen, Table 6: Small Universe (m = 352) | SPA_c and RC_u p-values | 0.048 and 0.106 |
| Hansen, Table 6: Full Universe (m = 3,656) | SPA_c and RC_u p-values | 0.100 and 0.963 |
I recomputed Example 4 (14.2% and 53.0%) and the equivalent data lost (33%, 66% and 84%). Each agrees with the text.
Where the claims go beyond the evidence
Hansen's simulations are the easy case. The losses are IID Normal, and the bootstrap runs with q = 1, no blocks. Nothing tests serial dependence, fat tails or heteroskedastic losses, though the theory and the empirical work rely on the block bootstrap.
White's paper has no size or power study. The theory is asymptotic, and the empirical example has no known truth. White names finite-sample simulation as "a top priority", and cites Sullivan and White (1999), which finds the test "typically (though not always)" conservative.
SPA_c over-rejects a little in small samples. At m = 100 and n = 200 it rejects 6.0% at the 5% level, and at m = 1,000 it rejects 6.2%. Hansen reports this, and the excess goes away at n = 1,000.
Both tests ask whether any model beats the benchmark, not which ones. A rejection doesn't say which models are better. That needs a stepwise method, such as Romano and Wolf (#19).
The Sharpe ratio isn't an expected loss. Hansen's framework needs an expected loss, such as the mean return of a trading rule. A Sharpe ratio test needs White's Section 2.c extension, and Hansen doesn't treat it.
Recursive estimation is excluded. Hansen's test does not allow parameters estimated on an expanding window. Only fixed or rolling estimation is allowed. He states this limit himself.
Errors in Hansen's text. Example 4 writes the alternative's distribution as Φ(x + 2). It must be Φ(x − 2) to give the stated 15% and 53%, and Φ(x − 2) is what I used. Table 3 labels the panels for Λ₀ = 2, 5 and 10 all as "Panel B". Figure 4 uses Λ₀ = 20, which is not in the tables.
Credit. Hansen flags his own Small Universe result as data mined, and reports the Full Universe to account for it. White shows that the naive p-value of the best model (.0036) can mislead badly.
Use in this repo
#11 already names SPA, and White's trading example matches the repo. White's Example 2.2 compares a long, flat or short rule with buy-and-hold, by log returns. That is the repo's own setting: a strategy's returns against buy-and-hold and 1/N.
The test statistic needs a choice. SPA on mean log returns is the tested form. SPA on Sharpe ratios needs White's extension, and neither paper simulates it. The harness (#87) could run SPA on mean excess return, and leave Sharpe inference to PSR and DSR (#8).
Poor strategies must not hide a good one. Hansen's Full Universe example shows the risk. Adding 3,304 poor forecasts moved RC's p-value from 0.106 to 0.963, and SPA_c's only from 0.048 to 0.100. The trial ledger (#7) will hold many weak variants, so the repo should use SPA_c, not RC.
The ledger must keep every trial's returns. Both tests need the full d_k,t series of every model tried, as PBO and DSR do. White's recursive form needs less: the running maximum, the bootstrap indexes and the random seed. That is a light way to keep a search honest across sessions.
Block length is a parameter to set. Hansen uses q = 0.25 for quarterly data, and White uses q = 0.5 for daily returns. The harness needs a rule for q at each frequency. White suggests a data-dependent choice, and #11 must pick one.
A question for the maintainer. For the verdict (#12), is the benchmark buy-and-hold of the strategy's own market, 1/N over its tickers, or both? And is it tested on mean excess return or on the Sharpe ratio?