arch.bootstrap.IndependentSamplesBootstrap.apply

IndependentSamplesBootstrap.apply(func, reps=1000, extra_kwargs=None)

Applies a function to bootstrap replicated data

Parameters
funccallable()

Function the computes parameter values. See Notes for requirements

repsint, default 1000

Number of bootstrap replications

extra_kwargsdict, default None

Extra keyword arguments to use when calling func. Must not conflict with keyword arguments used to initialize bootstrap

Returns
ndarray

reps by nparam array of computed function values where each row corresponds to a bootstrap iteration

Notes

When there are no extra keyword arguments, the function is called

func(params, *args, **kwargs)

where args and kwargs are the bootstrap version of the data provided when setting up the bootstrap. When extra keyword arguments are used, these are appended to kwargs before calling func

Examples

>>> import numpy as np
>>> x = np.random.randn(1000,2)
>>> from arch.bootstrap import IIDBootstrap
>>> bs = IIDBootstrap(x)
>>> def func(y):
...     return y.mean(0)
>>> results = bs.apply(func, 100)
Return type

ndarray