arch.bootstrap.MCS¶
-
class arch.bootstrap.MCS(losses: ndarray[tuple[int, int], dtype[float64]] | DataFrame, size: float, reps: int =
1000, block_size: int | None =None, method: 'r' | 'max' ='r', bootstrap: 'stationary' | 'sb' | 'circular' | 'cbb' | 'moving block' | 'mbb' ='stationary', *, seed: int | Generator | RandomState | None =None)[source]¶ Model Confidence Set (MCS) of Hansen, Lunde and Nason.
- Parameters:¶
- losses: ndarray[tuple[int, int], dtype[float64]] | DataFrame¶
T by k array containing losses from a set of models. There must be at least one row and two columns, and the losses must be finite.
- size: float¶
Value in (0,1) to use as the test size when implementing the MCS. There is no default value.
- reps: int =
1000¶ Number of bootstrap replications to use. Must be at least 1.
- 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.
- method: 'r' | 'max' =
'r'¶ MCS test and elimination implementation method, either “max” or “r”. Not case sensitive.
- 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
- 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, seed is not an integer, a Generator, a RandomState or None, an option is not a string, or the losses cannot be converted to float64.
ValueError – If the losses are not 2-d with at least one row and two columns, or 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, or an option is not one of the allowed values.
Notes
See [1] for details.
References
Methods
compute()Compute the set of models in the confidence set.
reset()Reset the bootstrap to its initial state.
Properties
The bootstrap used in the comparison.
List of model indices that are excluded from the MCS.
List of model indices that are included in the MCS.
Model p-values for inclusion in the MCS.