Reality Check

The Reality Check of White (2000) was the first test of the best of many strategies that accounts for the search: it compares the largest average excess return with its bootstrapped distribution when every strategy is exactly as good as the benchmark.

The formula for the Reality Check starts from the excess return \(d_{k , t}\) of every ticker k over the benchmark in period t and its average over the n periods:

\[d_{k,t} = \text{Return}_{k,t} - \text{Benchmark Return}_{t}\] \[\bar{d}_{k} = \frac{\sum_{t=1}^{n} d_{k,t}}{n}\]

The statistic V is the largest scaled average excess return over the tickers k:

\[V = \max\left(\sqrt{n} \cdot \bar{d}_{k}\right)\]

Each bootstrap resample b gives the average excess return bar(d_{k,b}) of every ticker, recentered at its own average, as if every ticker were exactly as good as the benchmark:

\[V_{b} = \max\left(\sqrt{n} \cdot (\bar{d}_{k,b} - \bar{d}_{k})\right)\]

The p-value is the share of the B resamples whose statistic exceeds V:

\[I_{b} = 1 \quad \text{if } V_{b} > V\] \[I_{b} = 0 \quad \text{if } V_{b} \leq V\] \[\text{P Value} = \frac{\sum_{b=1}^{B} I_{b}}{B}\]

A p-value below the significance level means the best ticker beats the benchmark after the search. Recentering every ticker at its average treats a ticker far worse than the benchmark as if it were as good, which widens the distribution of the best one: the test is conservative, and a few poor tickers make it miss a good one. The averages are not studentized, so the most volatile tickers dominate the maximum.

A data-snooping test asks whether the best of many strategies, funds or trading rules beats a benchmark once the search for the best is taken into account. Picking the best of many and testing it on its own overstates its significance: among enough strategies without any edge, one beats the benchmark by chance. These tests treat the tickers as the strategies searched and judge the best one against the bootstrapped distribution of the best of all of them. The null hypothesis is that no ticker beats the benchmark on average, the alternative that at least one does. The bootstrap draws B resamples of the periods with the stationary bootstrap of Politis and Romano (1994), blocks of consecutive periods of a random length, which keeps the dependence of the returns over time. A p-value below the chosen significance level (such as 0.05) means the best ticker still beats the benchmark after the search; the result only covers the tickers tested, not the strategies tried and discarded before.

Also known as: White’s Reality Check, RC test, data snooping test.

In the Finance Toolkit this is get_data_snooping_test with method="reality_check", the same function as Data Snooping Test.

Example · XLK, XLF, XLE, XLV, 5 more · 2016 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_data_snooping_test:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["XLK", "XLF", "XLE", "XLV", "XLY", "XLP", "XLI", "XLU", "XLB"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2016-01-01",
    end_date="2025-12-31",
)

toolkit.econometrics.get_data_snooping_test(method="reality_check")

Which returns:

Item Reality Check
Best Strategy XLK
Average Excess Return 0.0003
Statistic 0.0164
P-Value 0.205
Strategies 9
Observations 2513

Using Your Own Data

get_data_snooping_test runs on any data, not only prices: ratios, economic indicators, yield curves or your own dataset. Pass a DataFrame, a Series or a dictionary of them to Econometrics as data, with the dates in the rows or the columns, and set changes to how its changes are calculated: "percentage", "log", "difference" for rates and ratios, or None when the data are changes already. For example, for the monthly unemployment rates of the United States and Germany:

from financetoolkit import Economics, Econometrics

economics = Economics(start_date="2000-01-01")

unemployment = economics.get_unemployment_rate(
    countries=["United States", "Germany"], period="monthly"
)

econometrics = Econometrics(data=unemployment, changes="difference")

econometrics.get_data_snooping_test()

References

  • Paper White, H. (2000). “A Reality Check for Data Snooping.” Econometrica, 68(5), 1097-1126.
  • Paper Politis, D.N. and Romano, J.P. (1994). “The Stationary Bootstrap.” Journal of the American Statistical Association, 89(428), 1303-1313.
Share