A bootstrap confidence interval gives a range of plausible values for a statistic using only resampling, with no formula for its standard error. The bootstrap supplies a distribution of the statistic from repeated resampling of the data; the interval methods below differ in how they turn that distribution into a range. The choice matters most when the data are skewed or the sample is small.
From resamples to a range:
Percentile interval. The simplest method takes the middle $95\%$ of the bootstrap statistics. If $\hat{\theta}^{(b)}$ is the statistic from resample $b$, the interval is the $2.5\%$ and $97.5\%$ quantiles:
It is easy to explain and invariant to monotone transformations, but it inherits any bias or skew in the bootstrap distribution.
BCa interval. The bias-corrected and accelerated interval reads off shifted percentiles. Writing $\Phi$ for the standard normal distribution function, $z_\alpha$ for its quantile, $z_0$ for the bias correction and $a$ for the acceleration, the adjusted level for each end is:
Here $z_0$ measures how far the bootstrap median sits from the observed statistic, and $d_i$ is the leave-one-out jackknife deviation, so $a$ measures how the statistic's variability changes with its value. With $z_0=a=0$ this reduces to the percentile interval.
Worked example. The same ten chamber cleans as in the bootstrap entry, $4.1,\,4.4,\,4.6,\,4.9,\,5.0,\,5.3,\,5.8,\,6.5,\,8.2,\,11.9$ minutes, give a mean of $6.07$ and a sample skewness of $1.96$. Using $10{,}000$ resamples with seed $2026$, the three intervals for the mean are:
| Method | 95% interval | Width |
|---|---|---|
| Percentile bootstrap | $[4.88,\ 7.62]$ | $2.74$ |
| BCa bootstrap | $[5.06,\ 8.23]$ | $3.17$ |
| Classical t interval | $[4.37,\ 7.77]$ | $3.40$ |
For this sample $z_0=0.092$ and $a=0.087$, so BCa reads the percentiles at $6.5\%$ and $99.5\%$ instead of $2.5\%$ and $97.5\%$. That moves the interval to the right, where the long tail of large values says the true mean could plausibly lie. The by-hand calculation matches scipy.
A reality check on coverage. A $95\%$ interval should contain the true value in $95\%$ of repeated experiments. To test that, I simulated $600$ samples of $10$ cleaning times from a right-skewed lognormal population whose true mean is $5.93$, and checked each method. The classical t interval covered the truth $92.7\%$ of the time, the percentile bootstrap only $88.3\%$ and BCa $88.7\%$, with Monte Carlo error of about $\pm1.3$ points. The bootstrap intervals are narrower, on average $4.06$ and $4.35$ minutes against $5.03$ for the t interval, because resamples of ten values cannot reproduce the rare large values in the population.
Practical guidance.
- Small samples: with fewer than about $30$ observations, bootstrap intervals tend to be too narrow, especially for skewed data. Do not treat the bootstrap as a way around having little data.
- Prefer BCa or studentized: for means, medians and other smooth statistics, BCa is usually better than the plain percentile, and the bootstrap-$t$ often performs best.
- Known failures: the bootstrap is unreliable for the minimum, the maximum and other extremes, and for heavy-tailed data where the mean barely exists.
- Resample the right unit: for grouped or paired data, resample whole groups or pairs, otherwise the intervals will be too narrow.
- Report the details: give the method, the number of resamples, and the seed. At least $5{,}000$ resamples are advisable for interval endpoints.
- Compare methods: when the percentile, BCa and classical intervals disagree strongly, as here, that disagreement is itself information about how skewed the data are.
Read a bootstrap interval as the spread of answers you would get from your own data re-collected many times, adjusted for bias and skew, and remember that small, skewed samples can still make it too optimistic.