# arch.bootstrap.SPA¶

class arch.bootstrap.SPA(benchmark, models, block_size=None, reps=1000, bootstrap='stationary', studentize=True, nested=False)[source]

Test of Superior Predictive Ability (SPA) of White and Hansen.

The SPA is also known as the Reality Check or Bootstrap Data Snooper.

Parameters
• benchmark ({ndarray, Series}) – T element array of benchmark model losses

• models ({ndarray, DataFrame}) – T by k element array of alternative model losses

• block_size (int, optional) – Length of window to use in the bootstrap. If not provided, sqrt(T) is used. In general, this should be provided and chosen to be appropriate for the data.

• reps (int, optional) – Number of bootstrap replications to uses. Default is 1000.

• bootstrap (str, optional) – Bootstrap to use. Options are ‘stationary’ or ‘sb’: Stationary bootstrap (Default) ‘circular’ or ‘cbb’: Circular block bootstrap ‘moving block’ or ‘mbb’: Moving block bootstrap

• studentize (bool) – Flag indicating to studentize loss differentials. Default is True

• nested=False – Flag indicating to use a nested bootstrap to compute variances for studentization. Default is False. Note that this can be slow since the procedure requires k extra bootstraps.

References

White, H. (2000). “A reality check for data snooping.” Econometrica 68, no. 5, 1097-1126.

Hansen, P. R. (2005). “A test for superior predictive ability.” Journal of Business & Economic Statistics, 23(4)

Notes

The three p-value correspond to different re-centering decisions.
• Upper : Never recenter to all models are relevant to distribution

• Consistent : Only recenter if closer than a log(log(t)) bound

• Lower : Never recenter a model if worse than benchmark

See 1 and 2 for details.

References

1

Hansen, P. R. (2005). A test for superior predictive ability. Journal of Business & Economic Statistics, 23(4), 365-380.

2

White, H. (2000). A reality check for data snooping. Econometrica, 68(5), 1097-1126.

Methods

 better_models([pvalue, pvalue_type]) Returns set of models rejected as being equal-or-worse than the benchmark Compute the bootstrap pvalue. critical_values([pvalue]) Returns data-dependent critical values Reset the bootstrap to its initial state. seed(value) Seed the bootstrap’s random number generator subset(selector) Sets a list of active models to run the SPA on.

Properties

 pvalues P-values corresponding to the lower, consistent and upper p-values.