Hexa Scholar

The bootstrap: resampling your own data

A small clay figure stands inside a large navy boot and pulls up on its two gold pull-straps.
Pulling yourself up by your own bootstraps: the bootstrap learns about uncertainty from the one sample you already have.

The question

Make an estimate, then let the sample stand in for its population.

  1. 1 SeeEstimate uncertainty from one sample.
  2. 2 TryChoose a resampling rule.
  3. 3 ProveBuild the proof, line by line.
  4. 4 ApplyCompute errors and interval endpoints.
Before you start · 3 quick checks on averages, variance and empirical probabilities

Two ideas before you start

2 ideas

A sample becomes a small population

A bar at each distinct observation shows the fraction of sample entries with that value.

Pick a sample entry at random. Repeated values get more probability because they occupy more entries.

Exact definition

For observed real numbers \(x_1,\ldots,x_n\), the empirical distribution puts probability \(1/n\) on each indexed entry. A value appearing \(k\) times has total probability \(k/n\). Its CDF counts the fraction of entries at or below a cutoff, as in empirical quantiles.

A statistic summarizes a whole sample

Observations lie on a number line. A dashed mark locates their mean.

The mean is one number computed from all the observations. A different sample can give a different mean.

Exact definition

A statistic is a function of the observed sample. Here it is the arithmetic mean, \(\bar{x}=n^{-1}\sum_i x_i\). Uppercase \(\bar{X}\) denotes this statistic before the random sample has been observed; lowercase \(\bar{x}\) denotes its realized value.

Refresher: sampling distributions and standard error

Repeat the entire data collection under the same conditions. Compute the statistic once per sample. The probability distribution of those statistics is its sampling distribution. Its standard deviation is the standard error, abbreviated SE. This is the spread of a statistic across samples, not the spread of observations within a sample.

We assume observations are independent draws from one unchanged population distribution. Independent means that learning one draw does not change the probabilities for another. If each draw has finite variance, the variance of their sum is the sum of their variances. This follows because the cross products of centered independent draws have expectation zero. No normal distribution is assumed. See expectation and variance for the underlying definitions.

1 See

Estimate how much the mean moves

These are simulated processing times, collected as independent draws from a fixed population. You initially see only one sample. The population stays hidden until you request the comparison. An estimate from so little data need not be close to the truth.

2 Try

Choose how to resample

3 Prove

Find the conditional variance

Theorem: the bootstrap mean

Fix \(n\ge2\) finite real observations that are not all equal. Write \(\bar{x}=n^{-1}\sum_i x_i\) and \(v=n^{-1}\sum_i(x_i-\bar{x})^2\), so \(v\gt0\). Let \(I_1,\ldots,I_n\) be independent uniform indices from the observed entries, and set \(X_j^*=x_{I_j}\). A star means probability is computed with the observed data held fixed.

\[\begin{aligned} E_*(\bar{X}^*)&=\bar{x},\\ \operatorname{Var}_*(\bar{X}^*)&=v/n.\end{aligned}\]

Here \(\bar{X}^*=n^{-1}\sum_j X_j^*\). The proof uses linearity of expectation, variance scaling by the square of a constant, and addition of variances for independent variables. The sampling-distribution refresher explains the last rule.

Choose the next true equation at each step. The observations may include negative numbers, repeated values and a mean of zero. The nonconstant assumption keeps the alternative variance formulas distinct.

4 Apply

Compute and interpret

Enter decimals without units. Each problem states its tolerance and offers hints and a worked solution. The first tasks use the exact conditional formulas; the last interprets a percentile interval.

Refresher: a bootstrap percentile interval

Sort the bootstrap statistics. For a nominal central interval, use the lower and upper empirical quantiles as endpoints. This page uses the inverse empirical CDF convention: at level \(p\), take rank \(\lceil Bp\rceil\) among \(B\) sorted replicates, without interpolation.

That construction describes the bootstrap distribution, conditional on this sample. A nominal confidence level is a target for repeated-sample coverage of a fixed population parameter. It is not a probability that the fixed parameter moves in or out of the realized interval. Actual coverage can differ, especially for small or biased samples, nonsmooth statistics and extreme quantiles. No interval coverage theorem is proved here.

Key point Report the statistic, the resampling unit, the resample size, the replicate count and the interval convention. A stable simulation is useful only when the data and resampling rule represent the uncertainty being studied.
Level UndergraduatePrerequisites Means, variances and empirical probabilities; sampling distributions refreshed aboveTime About 35 min

Continue with sampling distributions. The normal distribution gives another language for location and spread, but the bootstrap histograms here do not assume normality.

Further reading