arch.bootstrap.StepM¶
-
class arch.bootstrap.StepM(benchmark: ndarray | DataFrame | Series, models: ndarray | DataFrame | Series, size: float =
0.05, block_size: int | None =None, reps: int =1000, bootstrap: 'stationary' | 'sb' | 'circular' | 'cbb' | 'moving block' | 'mbb' ='stationary', studentize: bool =True, nested: bool =False, *, seed: int | Generator | RandomState | None =None)[source]¶ StepM multiple comparison procedure of Romano and Wolf.
- Parameters:¶
- benchmark: ndarray | DataFrame | Series¶
T element array of benchmark model losses. There must be at least three observations, and the losses must be finite.
- models: ndarray | DataFrame | Series¶
T by k element array of alternative model losses, with the same T as benchmark and k at least 1.
- size: float =
0.05¶ Value in (0,1) to use as the test size when implementing the comparison.
- block_size: int | None =
None¶ Length of window to use in the bootstrap, between 1 and T. If not provided, sqrt(T) is used. In general, this should be provided and chosen to be appropriate for the data.
- reps: int =
1000¶ Number of bootstrap replications to use. Must be at least 1.
- bootstrap: 'stationary' | 'sb' | 'circular' | 'cbb' | 'moving block' | 'mbb' =
'stationary'¶ Bootstrap to use. Not case sensitive. Options are
”stationary” or “sb”: Stationary bootstrap
”circular” or “cbb”: Circular block bootstrap
”moving block” or “mbb”: Moving block bootstrap
- studentize: bool =
True¶ Flag indicating to studentize loss differentials. Studentization is also applied inside each bootstrap replication, see
SPA. If False, the loss differentials are not studentized.- nested: bool =
False¶ Flag indicating to use a nested bootstrap to compute the variances used to studentize, instead of the kernel estimator of the long-run variance that matches the bootstrap. The variances are computed in the original data and in each bootstrap replication, so the procedure uses reps squared resamples and can be very slow. Can only be True when studentize is True.
- seed: int | Generator | RandomState | None =
None¶ Seed value to use when creating the bootstrap used in the comparison. If an integer or None, the NumPy default_rng is used with the seed value. If a Generator or a RandomState, the argument is used.
- Raises:¶
TypeError – If reps or block_size is not an integer, size is not a real number, studentize or nested is not a bool, seed is not an integer, a Generator, a RandomState or None, bootstrap is not a string, or the losses cannot be converted to float64.
ValueError – If benchmark is not 1-d, models is not 2-d with T rows, there are fewer than three observations, the losses contain NaN or inf, size is not in (0,1), reps is less than 1, block_size is not between 1 and T, seed is negative, nested is True and studentize is False, or bootstrap is not one of the allowed values.
See also
arch.bootstrap.SPATest of Superior Predictive Ability of White and Hansen.
Notes
The size controls the Family Wise Error Rate (FWER) since this is a multiple comparison procedure. Uses SPA and the consistent selection procedure.
See
SPAfor a description of how loss differentials are studentized.See [1] for detail.
References
Methods
compute()Compute the set of superior models.
reset()Reset the bootstrap to its initial state.
Properties
The bootstrap used in the comparison.
List of the indices or column names of the superior models.