arch.bootstrap.IndependentSamplesBootstrap.bootstrap

IndependentSamplesBootstrap.bootstrap(reps)

Iterator for use when bootstrapping

Parameters
repsint

Number of bootstrap replications

Returns
generator

Generator to iterate over in bootstrap calculations

Notes

The iterator returns a tuple containing the data entered in positional arguments as a tuple and the data entered using keywords as a dictionary

Examples

The key steps are problem dependent and so this example shows the use as an iterator that does not produce any output

>>> from arch.bootstrap import IIDBootstrap
>>> import numpy as np
>>> bs = IIDBootstrap(np.arange(100), x=np.random.randn(100))
>>> for posdata, kwdata in bs.bootstrap(1000):
...     # Do something with the positional data and/or keyword data
...     pass

Note

Note this is a generic example and so the class used should be the name of the required bootstrap

Return type

Generator[Tuple[Tuple[Union[ndarray, DataFrame, Series], …], Dict[str, Union[ndarray, DataFrame, Series]]], None, None]