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 : data : array_like
A 1-dimensional data array of size n_samples
user_statistic : function
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.
kwargs : dictionary (optional)
A dictionary of keyword arguments to be passed to the user_statistic function.
return_raw_distribution : boolean (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_indices : boolean (optional)
if True, then the indices of the points rather than the points themselves are passed to user_statistic
Returns : mean, stdev : floats
The mean and standard deviation of the jackknifed distribution
raw_distribution : ndarray
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.)