Chip Foundry Services Request Assessment

Bootstrap

The bootstrap estimates how much a statistic would vary from sample to sample using only the one sample you have. It treats the observed data as a stand-in for the population, draws new samples from it with replacement, recomputes the statistic each time, and reads the uncertainty off the spread of those recomputed values. It needs no formula for the standard error, which makes it useful for medians, ratios, correlations and other statistics where no simple formula exists.

The loop:

One sample of n observations
all you have: 10 cleaning times
Repeat B times (B = 10,000)the sample stands in for the population
Draw n values with replacement
some repeat, some are left out
Recompute the statistic
median, mean, ratio, anything
Look at the B statistics
their spread is the standard error; their percentiles give an interval

The algorithm. Given observations $x_1,\dots,x_n$ and a statistic $T$, such as the median:

$$x^{(b)}=\left(x^{(b)}_1,\dots,x^{(b)}_n\right)\ \text{drawn from}\ \{x_1,\dots,x_n\}\ \text{with replacement},\qquad T^{(b)}=T\!\left(x^{(b)}\right),\quad b=1,\dots,B$$

The bootstrap standard error is the standard deviation of the $B$ values $T^{(b)}$, and the percentile interval is formed from their $2.5\%$ and $97.5\%$ quantiles. Because each resample has the same size as the original, the statistic is computed on data that look as variable as the real sample.

Worked example. Ten chamber cleans take $4.1,\,4.4,\,4.6,\,4.9,\,5.0,\,5.3,\,5.8,\,6.5,\,8.2,\,11.9$ minutes. The data are right-skewed: the mean is $6.07$ minutes but the median is $5.15$. There is no handy standard-error formula for a median, so we resample. Drawing $B=10{,}000$ resamples (fixed random seed $2026$ so the result can be reproduced) gives medians whose standard deviation is $0.61$ minutes, and the middle $95\%$ of them run from $4.6$ to $7.0$ minutes. scipy's bootstrap routine gives the same numbers.

A bootstrap distribution of the median 10,000 resamples of the 10 cleaning times, each drawn with replacement; observed median 5.15 min 4 6 8 10 12 median cleaning time in a resample (minutes) observed median 5.15 middle 95% of resampled medians: 4.6 to 7 minutes bootstrap standard error 0.61 the long right tail: a few resamples keep the 8.2 and 11.9 minute cleans and drag the median up

The histogram is lopsided to the right for a reason worth understanding: when a resample happens to include the $8.2$ or $11.9$ minute clean more than once, it pulls the median upward, but there is no equally extreme low value to pull it downward. The interval reflects that skew, instead of forcing a symmetric plus-or-minus.

Why resampling works. In a resample of $n$ values, each original observation is left out with probability $(1-1/n)^n$, which is $0.349$ for $n=10$ and tends to $1/e\approx0.368$ for large $n$. A typical resample therefore contains about $6.5$ distinct original values out of $10$, with the rest repeated. This is the same sampling variation that a new draw from the process would show, approximated using the sample's own empirical distribution.

Using it well.

  • Number of resamples: $B=1{,}000$ is enough for a standard error and $5{,}000$ to $10{,}000$ for percentile intervals. Report the seed, because bootstrap results are random.
  • Sample size matters: the bootstrap cannot create information. With very small samples, or for statistics tied to the extremes such as the minimum or maximum, it can badly understate uncertainty.
  • Independence: plain resampling assumes independent observations. For time series or grouped data, resample blocks or whole groups, not single values.
  • Better intervals: the percentile interval can be biased when the statistic is skewed. The BCa method corrects for bias and skew and is the safer default in published work.
  • Compare with theory: for the mean, the formula $s/\sqrt{n}=0.75$ and the bootstrap standard error of $0.72$ agree closely, which is a useful check on both.
  • Not magic: it quantifies sampling variation only. A biased sample or a measurement error stays biased however many resamples you draw.

Read the bootstrap as asking how much the answer would wobble if the data were collected again, answered by collecting the data again from the data you already have.