11.13.2. astroML.resample.jackknife

astroML.resample.jackknife(data, user_statistic, kwargs=None, return_raw_distribution=False, pass_indices=False)[source]

Compute first-order jackknife statistics of the data.

Parameters
dataarray_like

A 1-dimensional data array of size n_samples

user_statisticfunction

The statistic to be computed. This should take an array of data of size (n_samples, n_samples - 1) and return an array of size n_samples or tuple of arrays of size n_samples, representing the row-wise statistics of the input.

kwargsdictionary (optional)

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

return_raw_distributionboolean (optional)

if True, return the raw jackknife distribution. Be aware that this distribution is not reflective of the true distribution: it is simply an intermediate step in the jackknife calculation

pass_indicesboolean (optional)

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

Returns
mean, stdevfloats

The mean and standard deviation of the jackknifed distribution

raw_distributionndarray

Returned only if return_raw_distribution is True The array containing the raw distribution (length n_samples) Be aware that this distribution is not reflective of the true distribution: it is simply an intermediate step in the jackknife calculation

Notes

This implementation is a leave-one-out jackknife. Jackknife resampling is known to fail on rank-based statistics (e.g. median, quartiles, etc.) It works well on smooth statistics (e.g. mean, standard deviation, etc.)