What is the bootstrap, how do you construct a percentile confidence interval from resamples, and why does it not need parametric assumptions? For example, how would you put a 95% interval on the median order value from a sample of Amazon purchases without assuming the order values follow any particular distribution?

The Problem: One right-skewed sample of 40 order values gives one sample median, and the population shape is unknown. No textbook standard-error formula for a median avoids that unknown shape, and drawing a second sample is not an option.
Answer
The bootstrap estimates the sampling distribution of a statistic by treating the observed sample as a stand-in for the population and redrawing from it. You draw points with replacement from your
observations, recompute the statistic (a median, a ratio of means, an AUC), and repeat this
times, typically 1,000 to 10,000. The spread of the
replicates approximates how much the statistic would vary across fresh samples from the real population. The percentile interval then reads a 95% confidence interval directly off the 2.5th and 97.5th percentiles of those replicates. No parametric assumption is needed because the empirical distribution of the data replaces the unknown population, so there is no normality assumption and no closed-form standard error to derive. The method is nonparametric but not assumption-free, since it still requires independent resampling units, a sample large enough to represent the population, and a reasonably smooth statistic.
(1) Plug-In Principle: The unknown population is replaced by the empirical distribution
, which puts mass
on each observation. Resampling shows how the statistic would vary if
were the population, and that approximates how it varies under
.
(2) Same Size, With Replacement: Each resample has exactly draws, so some points repeat and only about
of the originals appear. Drawing without replacement would return the original sample every time and show zero variability.
(3) Percentile Interval: Sort the replicates and take the
and
quantiles. With
at 95% confidence these are the 50th and 1950th sorted values.
(4) No Formula Required: The same loop gives intervals for medians, ratios of means, trimmed means, correlations, and model metrics such as AUC, where an analytic standard error is messy or unknown.
(5) Assumptions That Remain: Resampled units must be i.i.d., must be large enough for
to resemble
, and the statistic must be smooth. Percentile intervals are only first-order accurate, which is what BCa and studentized intervals improve.
Mathematical Formulation:
Where:
is the statistic computed on the observed data by the function
, and
are the
observed i.i.d. units.
is the empirical CDF, putting mass
on each observation, and
is the indicator function; sampling from
is the same as drawing indices uniformly with replacement.
indexes the resamples,
is the
-th draw of resample
, and
is the bootstrap replicate of the statistic.
is the
-quantile of the
replicates and
is the confidence level, so
uses the 2.5th and 97.5th percentiles.
is the bootstrap standard error and
is the mean of the replicates;
is the bootstrap estimate of bias.
Worked Example:
Take the five observations {2, 3, 5, 8, 40}, whose sample median is 5. A resample’s median is its third-smallest value, so it is at most the -th order statistic
exactly when at least three of the five draws land at or below
. That is a binomial event with success probability
, for example
. Working through
gives the exact bootstrap distribution of the median: 2 with probability 0.058, 3 with 0.260, 5 with 0.365, 8 with 0.260, and 40 with 0.058. Monte Carlo resampling converges to exactly this distribution as
grows. Because 5.8% of the mass already sits on each extreme, the 2.5th percentile is 2 and the 97.5th is 40, so the 95% percentile interval is the entire data range. The bootstrap is being honest: five points cannot pin down a median, and no resampling scheme can manufacture information the sample does not contain.
Leave a Reply