Initializing playground…
← Back to roadmap

Bootstrap Confidence Intervals

Non-parametric bootstrap resampling for confidence intervals and standard errors — mirrors scipy.stats.bootstrap with percentile, basic, and BCa methods.

1 — Basic 95% CI for the mean (BCa)

Use bootstrap1 for single-sample statistics. The default method is BCa (bias-corrected and accelerated).

JavaScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

2 — Compare percentile, basic, and BCa methods

All three methods are available via the method option. BCa is generally preferred for skewed distributions.

JavaScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

3 — CI for median (BCa)

Any statistic function can be passed — here we compute a 95% BCa confidence interval for the median.

JavaScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

4 — Two-sample bootstrap (mean difference)

Use bootstrap for multi-sample statistics. Each sample is resampled independently.

JavaScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent

5 — Bootstrap distribution histogram

The bootDistribution property gives access to all resampled statistic values for custom analysis.

JavaScript
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent