Resampling✓ Mathematical
◆ The PatternEstimate anything with resampling — the nonparametric Swiss army knife for uncertainty
Bootstrap resamples your data with replacement thousands of times, computing your statistic each time. The distribution of bootstrap estimates approximates the sampling distribution of your statistic — giving you standard errors and CIs without formulas.
θ* = statistic(resample(data))
Repeat B times → distribution of θ* → SE = std(θ*) | CI = percentiles
// Interactive — bootstrap distribution of the mean
Resamples1000
SE—
# Python — bootstrap for any statistic import numpy as np def bootstrap(data, stat_fn, B=10000): n = len(data) estimates = [stat_fn(np.random.choice(data, n, replace=True)) for _ in range(B)] return np.array(estimates) # Bootstrap the median (no formula needed!) boots = bootstrap(data, np.median) ci = np.percentile(boots, [2.5, 97.5]) se = boots.std()
BCa (bias-corrected and accelerated): The basic percentile method works but BCa is more accurate for skewed distributions.
scipy.stats.bootstrap offers this.