The Bootstrap: Uncertainty When the Algebra Runs Out
Published:
The substitution
The quantity you want is the sampling distribution of \(\hat\theta\) under the true \(F\) — and you cannot have it, because you have one sample, not many, and you do not know \(F\). The bootstrap replaces \(F\) with \(\hat F_n\), the empirical distribution putting mass \(1/n\) on each observed point, and samples from that. Sampling from \(\hat F_n\) is exactly drawing \(n\) points with replacement.
The spread of \(\{\hat\theta^{*(b)}\}\) estimates the spread of \(\hat\theta\). The justification is asymptotic: \(\hat F_n \to F\) uniformly by Glivenko–Cantelli, and for smooth enough statistics the bootstrap distribution converges to the true sampling distribution. Note that a bootstrap resample omits any given observation with probability \((1-1/n)^n \to e^{-1} = 0.368\), so each resample uses about 63% of the distinct data points — the fact behind out-of-bag error in random forests.
A worked interval
Twelve request latencies in milliseconds: 12, 13, 14, 15, 15, 16, 18, 19, 22, 27, 41, 88. The mean is 25.0 and \(s = 21.40\), so the normal-theory interval is \(25 \pm 2.201 \times 6.178 = [11.40,\ 38.60]\), using \(t^\star_{11} = 2.201\).
The percentile bootstrap takes the 2.5th and 97.5th percentiles of the resampled means directly. One run of \(B = 10{,}000\) resamples gives \([16.08,\ 38.25]\), with a bootstrap standard error of 5.89 against the formula’s 6.18.
The bootstrap interval is asymmetric because the bootstrap distribution is — the right answer for skewed data, and one the \(t\) interval cannot give since it is symmetric by construction.
Where it fails
The failure cases are the interview question.
Extremes. For \(\hat\theta = \max_i x_i\), every resample maximum is one of the observed values and equals the sample maximum with probability \(1 - (1-1/n)^n \approx 0.632\). The bootstrap distribution has an atom of mass there and cannot represent the smooth true one. Bickel and Freedman (1981) give the condition: the statistic must depend smoothly on the underlying distribution, and extreme order statistics do not.
Heavy tails. With infinite variance — a Cauchy, or a Pareto with tail index below 2 — the sample mean has no limiting normal distribution and the bootstrap is inconsistent for it.
Dependence. The resampling step assumes exchangeability. Applied naively to a time series it destroys autocorrelation, so it will underestimate the variance of a mean by a factor that grows with the dependence. The fix is to resample contiguous blocks — the moving-block or stationary bootstrap (Politis and Romano, 1994) — with block length long enough to preserve the correlation structure.
Permutation tests
To test whether two groups differ, apply the same trick to the null. Under \(H_0\) the group labels are meaningless, so any reassignment is as likely as the one observed: enumerate the relabellings, compute the statistic for each, and see where the observed value lands.
Group A: 12, 15, 15, 18. Group B: 22, 27, 41, 88. The observed difference of means is \(44.5 - 15.0 = 29.5\). There are \(\binom{8}{4} = 70\) ways to split eight numbers into two groups of four, and exactly 2 of them — the observed split and its mirror image — give a difference of 29.5 or more in absolute value. So the exact two-sided p-value is \(2/70 = 0.029\).
Cross-validation is resampling too
\(k\)-fold CV is a resampling estimate of generalisation error, and it inherits a resampling problem: the folds are not independent. Any two training sets in 5-fold CV share three of the five parts — 75% of each training set — so the models are correlated, and so are their errors.
The naive standard error \(s/\sqrt{k}\) across folds therefore understates the true variability, often badly. Bengio and Grandvalet (2004) proved something stronger: there is no unbiased estimator of the variance of \(k\)-fold cross-validation. Fold spread is a rough signal, not a confidence interval.
Recap
- Resample \(n\) points with replacement, recompute, repeat. Each resample misses about 36.8% of the distinct points, since \((1-1/n)^n \to e^{-1}\).
- Percentile CI = the 2.5th and 97.5th percentiles of the resampled statistics; it inherits the skew of the data, unlike a symmetric \(t\) interval.
- Fails for extremes, infinite-variance tails and dependent data; use a block bootstrap for time series.
- Permutation tests give exact p-values, but resolution is limited by the number of relabellings: 4 versus 4 bottoms out at \(2/70 = 0.029\).
- k-fold CV is resampling with correlated folds — no unbiased variance estimator exists, so do not read fold spread as a confidence interval.
References
- Efron, B. Bootstrap Methods: Another Look at the Jackknife. The Annals of Statistics, 7(1), 1–26, 1979.
- Bickel, P. J., & Freedman, D. A. Some Asymptotic Theory for the Bootstrap. The Annals of Statistics, 9(6), 1196–1217, 1981.
- Politis, D. N., & Romano, J. P. The Stationary Bootstrap. Journal of the American Statistical Association, 89(428), 1303–1313, 1994.
- Bengio, Y., & Grandvalet, Y. No Unbiased Estimator of the Variance of K-Fold Cross-Validation. Journal of Machine Learning Research, 5, 1089–1105, 2004.
