Bootstrap where each input is independently resampled
Two-element tuple with the pos_data in the first position and kw_data in the second (pos_data, kw_data)
This bootstrap independently resamples each input and so is only appropriate when the inputs are independent. This structure allows bootstrapping statistics that depend on samples with unequal length, as is common in some experiments. If data have cross-sectional dependence, so that observation
iis related across all inputs, this bootstrap is inappropriate.
Supports numpy arrays and pandas Series and DataFrames. Data returned has the same type as the input date.
Data entered using keyword arguments is directly accessibly as an attribute.
To ensure a reproducible bootstrap, you must set the
random_stateattribute after the bootstrap has been created. See the example below. Note that
random_stateis a reserved keyword and any variable passed using this keyword must be an instance of
Data can be accessed in a number of ways. Positional data is retained in the same order as it was entered when the bootstrap was initialized. Keyword data is available both as an attribute or using a dictionary syntax on kw_data.
>>> from arch.bootstrap import IndependentSamplesBootstrap >>> from numpy.random import standard_normal >>> y = standard_normal(500) >>> x = standard_normal(200) >>> z = standard_normal(2000) >>> bs = IndependentSamplesBootstrap(x, y=y, z=z) >>> for data in bs.bootstrap(100): ... bs_x = data ... bs_y = data['y'] ... bs_z = bs.z
Set the random_state if reproducibility is required
>>> from numpy.random import RandomState >>> rs = RandomState(1234) >>> bs = IndependentSamplesBootstrap(x, y=y, z=z, random_state=rs)
apply(func[, reps, extra_kwargs])
Applies a function to bootstrap replicated data
Iterator for use when bootstrapping
Clones the bootstrap using different data.
conf_int(func[, reps, method, size, tail, …])
cov(func[, reps, recenter, extra_kwargs])
Compute parameter covariance using bootstrap
Gets the state of the bootstrap’s random number generator
Resets the bootstrap to either its initial state or the last seed.
Seeds the bootstrap’s random number generator
Sets the state of the bootstrap’s random number generator
Update indices for the next iteration of the bootstrap.
var(func[, reps, recenter, extra_kwargs])
Compute parameter variance using bootstrap
Returns the current index of the bootstrap
Set or get the instance random state