Stepwise Multiple Testing Procedure

The Stepwise Multiple Testing Procedure (StepM) of Romano and Wolf (2005) names every ticker that beats the benchmark, not only whether the best one does, while holding the probability of naming any ticker that does not (the familywise error rate) at alpha. Each step tests the tickers not yet found and removes the ones found, which makes it more powerful than testing every ticker against the same critical value.

The formula for the Stepwise Multiple Testing Procedure 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 \(T_{k}\) of each ticker is its studentized average excess return, with hat(omega_k) the standard deviation of sqrt(n) * bar(d_k) under the stationary bootstrap:

\[T_{k} = \frac{\sqrt{n} \cdot \bar{d}_{k}}{\hat{\omega}_{k}}\]

In every step the critical value c is the 1 - alpha quantile \(Q_{1 - \alpha}\), over the B bootstrap resamples with averages bar(d_{k,b}), of the largest recentered statistic among the tickers not yet found:

\[c = Q_{1-\alpha}\left(\max\left(\frac{\sqrt{n} \cdot (\bar{d}_{k,b} - \bar{d}_{k})}{\hat{\omega}_{k}}\right)\right)\]

Every ticker not yet found with \(T_{k}\) above c outperforms the benchmark; the step repeats on the remaining tickers until it finds no further one. The tickers found are those that beat the benchmark at the familywise error rate alpha, and the step at which each was found shows how clear its lead is. A ticker not found may still beat the benchmark by too little to tell apart from chance.

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: StepM, Romano-Wolf, multiple testing of strategies.

In the Finance Toolkit this is get_data_snooping_test with method="stepm", 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="stepm")

Which returns:

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 Romano, J.P. and Wolf, M. (2005). “Stepwise Multiple Testing as Formalized Data Snooping.” Econometrica, 73(4), 1237-1282.
  • Paper Politis, D.N. and Romano, J.P. (1994). “The Stationary Bootstrap.” Journal of the American Statistical Association, 89(428), 1303-1313.
  • Library Referenced against arch’s StepM (Stepwise Multiple Testing Procedure)
Share