Bootstrap
bootstrap
bootstrap (x1:<built-infunctionarray>, x2:<built-infunctionarray>=None, paired:bool=False, stat_function:<built- infunctioncallable>=<function mean>, smoothboot:bool=False, alpha_level:float=0.05, reps:int=5000)
Computes the summary statistic and a bootstrapped confidence interval.
Type | Default | Details | |
---|---|---|---|
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. |
Returns | An bootstrap object reporting the summary statistics, percentile CIs, bias-corrected and accelerated (BCa) CIs, and the settings used: |
summary : float.The summary statistic. is_difference : boolean.Whether or not the summary is the difference between two groups. If False, only x1 was supplied. is_paired : string, default NoneThe type of the experiment under which the data are obtained statistic : callableThe function used to compute the summary. reps : intThe number of bootstrap iterations performed. stat_array :arrayA sorted array of values obtained by bootstrapping the input arrays. ci :floatThe size of the confidence interval reported (in percentage). pct_ci_low,pct_ci_high :floatsThe upper and lower bounds of the confidence interval as computed by taking the percentage bounds. pct_low_high_indices :arrayAn array with the indices in stat_array corresponding to the percentage confidence interval bounds.bca_ci_low, bca_ci_high : floatsThe upper and lower bounds of the bias-corrected and accelerated(BCa) confidence interval. See Efron 1977. bca_low_high_indices : arrayAn array with the indices in stat_array corresponding to the BCa confidence interval bounds.pvalue_1samp_ttest : floatP-value obtained from scipy.stats.ttest_1samp. If 2 arrays were passed (x1 and x2), returns ‘NIL’. See https://docs.scipy.org/doc/scipy-1.0.0/reference/generated/scipy.stats.ttest_1samp.html pvalue_2samp_ind_ttest : floatP-value obtained from scipy.stats.ttest_ind. If a single array was given (x1 only), or if paired is not None, returns ‘NIL’. See https://docs.scipy.org/doc/scipy-1.0.0/reference/generated/scipy.stats.ttest_ind.htmlpvalue_2samp_related_ttest : floatP-value obtained from scipy.stats.ttest_rel. If a single array was given (x1 only), or if paired is None, returns ‘NIL’. See https://docs.scipy.org/doc/scipy-1.0.0/reference/generated/scipy.stats.ttest_rel.htmlpvalue_wilcoxon : floatP-value obtained from scipy.stats.wilcoxon. If a single array was given (x1 only), or if paired is None, returns ‘NIL’. The Wilcoxons signed-rank test is a nonparametric paired test of the null hypothesis that the related samples x1 and x2 are from the same distribution. See https://docs.scipy.org/doc/scipy-1.0.0/reference/scipy.stats.wilcoxon.htmlpvalue_mann_whitney : floatTwo-sided p-value obtained from scipy.stats.mannwhitneyu. If a single array was given (x1 only), returns ‘NIL’. The Mann-Whitney U-test is a nonparametric unpaired test of the null hypothesis that x1 and x2 are from the same distribution. See https://docs.scipy.org/doc/scipy-1.0.0/reference/generated/scipy.stats.mannwhitneyu.html |
bca
bca (data, alphas, stat_array, stat_function, ostat, reps)
Subroutine called to calculate the BCa statistics. Borrowed heavily from scikits.bootstrap code.
jackknife_indexes
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.