arch.bootstrap.IndependentSamplesBootstrap.bootstrap

IndependentSamplesBootstrap.bootstrap(reps: int) Generator[tuple[tuple[ndarray | DataFrame | Series, ...], dict[str, ndarray | DataFrame | Series]], None, None]

Iterator for use when bootstrapping

Parameters:
reps: int

Number of bootstrap replications

Returns:

Generator to iterate over in bootstrap calculations

Return type:

generator

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

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