Build inputs from evidenceLesson 23 of 76 · 8 min

The parameters are estimates too

Separate uncertainty about an estimated parameter from variation in future outcomes.

If a model parameter was estimated from a finite sample, treating it as known hides one source of uncertainty. A bootstrap can approximate uncertainty in a statistic by resampling independent observed units and recalculating that statistic.

Below each row is a bootstrap sample of invented independent demand days. Its mean is one bootstrap estimate of expected demand. Those means describe uncertainty in an estimated expectation under this resampling model. They are not a distribution of individual future daily demand. The percentile bootstrap interval takes the 2.5th and 97.5th percentiles of these recalculated means. It is an approximate interval for the expected demand, relying on representative independent days; small samples can give poor coverage.

For a predictive model, future outcome variation and parameter uncertainty can both matter, but they must be combined coherently. Simply adding their standard deviations or reusing the same variation twice does not create a justified model. Later Bayesian examples show another way to separate these layers.

did_i is original day i. A starred, barred d denotes the mean from one resampled set of days. In the question, classroom clustering means pupils in the same classroom can share dependence; the independent unit may be a whole classroom.

Resample evidence, not new reality
  1. Original independent days
    d1,…,d10d_1,\ldots,d_{10}
  2. Bootstrap whole days
    dˉ∗(1),…,dˉ∗(B)\bar d^{*(1)},\ldots,\bar d^{*(B)}
  3. Uncertainty about a mean

    bootstrap percentile interval

Reference illustration. The ten invented daily values are treated as independent and representative; the bootstrap approximates uncertainty about an expectation under that assumption. This is not the spread of tomorrow’s demand; copied rows do not create fresh evidence.

Will the bootstrap means have the same spread as individual daily demands?

Write a prediction (optional)

Seeded teaching simulation

Select Run Python below with the code unchanged.

Tools
About Python ↗

The code is editable. Press Ctrl+Enter or ⌘+Enter to run Python from the editor.

Published example output

This result comes from the original Python. Your runs appear above. Build environment ↗

Daily-demand SD: 12.239
Bootstrap SD of estimated mean: 3.666
Percentile bootstrap interval for mean: [52.8 67.1]

Read the first result

The interval is an approximate percentile-bootstrap interval for an expectation. It inherits the sample’s representativeness and independence assumptions.

Try an edit

Add observed = np.repeat(observed, 10) immediately after observed = np.array([42, 55, 61, 47, 83, 59, 66, 52, 74, 58]). Select Run Python again. Compare Daily-demand SD, Bootstrap SD of estimated mean and the Percentile bootstrap interval for mean. Why can a tighter interval from these copied rows be misleading?

Back to the Python editor

Scope. A bootstrap cannot recover unobserved populations or automatically repair correlated samples. Small-sample interval coverage can be poor.

Try a fresh case

You bootstrap individual pupils although treatment was assigned to entire classrooms. What is missing?

Choose an answer
Need a hint?
Hint 1

Find which observations share an environment or assignment.

Hint 2

Preserve that dependence in a suitable resampling design.

Your notes