Bootstrap


bootstrap


def bootstrap(
    x1:array, # The data in a one-dimensional array form. Only x1 is required. If x2 is given, the bootstrapped summary difference between the two groups (x2-x1) is computed. NaNs are automatically discarded.
    x2:array=None, # The data in a one-dimensional array form. Only x1 is required. If x2 is given, the bootstrapped summary difference between the two groups (x2-x1) is computed. NaNs are automatically discarded.
    paired:bool=False, # Whether or not x1 and x2 are paired samples. If 'paired' is None then the data will not be treated as paired data in the subsequent calculations. If 'paired' is 'baseline', then in each tuple of x, other groups will be paired up with the first group (as control). If 'paired' is 'sequential', then in each tuple of x, each group will be paired up with the previous group (as control).
    stat_function:callable=mean, # The summary statistic called on data.
    smoothboot:bool=False, # Taken from seaborn.algorithms.bootstrap. If True, performs a smoothed bootstrap (draws samples from a kernel destiny estimate).
    alpha_level:float=0.05, # Denotes the likelihood that the confidence interval produced does not include the true summary statistic. When alpha = 0.05, a 95% confidence interval is produced.
    reps:int=5000, # Number of bootstrap iterations to perform.
):

Computes the summary statistic and a bootstrapped confidence interval.


bca


def bca(
    data, alphas, stat_array, stat_function, ostat, reps
):

Subroutine called to calculate the BCa statistics. Borrowed heavily from scikits.bootstrap code.


jackknife_indexes


def jackknife_indexes(
    data
):

From the scikits.bootstrap package. Given an array, returns a list of arrays where each array is a set of jackknife indexes.

For a given set of data Y, the jackknife sample J[i] is defined as the data set Y with the ith data point deleted.