This documentation is for astroML version 0.2

This page

Links

astroML Mailing List

GitHub Issue Tracker

Videos

Scipy 2012 (15 minute talk)

Scipy 2013 (20 minute talk)

Citing

If you use the software, please consider citing astroML.

11.13.1. astroML.resample.bootstrap

astroML.resample.bootstrap(data, n_bootstraps, user_statistic, kwargs=None, pass_indices=False, random_state=None)[source]

Compute bootstraped statistics of a dataset.

Parameters :

data : array_like

A 1-dimensional data array of size n_samples

n_bootstraps : integer

the number of bootstrap samples to compute. Note that internally, two arrays of size (n_bootstraps, n_samples) will be allocated. For very large numbers of bootstraps, this can cause memory issues.

user_statistic : function

The statistic to be computed. This should take an array of data of size (n_bootstraps, n_samples) and return the row-wise statistics of the data.

kwargs : dictionary (optional)

A dictionary of keyword arguments to be passed to the user_statistic function.

pass_indices : boolean (optional)

if True, then the indices of the points rather than the points themselves are passed to user_statistic

random_state: RandomState or an int seed (0 by default) :

A random number generator instance

Returns :

distribution : ndarray

the bootstrapped distribution of statistics (length = n_bootstraps)