Loading lesson…
Bootstrapping estimates the uncertainty of any statistic, even when you have no clean mathematical formula. It is simple, powerful, and surprisingly deep.
You have 200 people's salaries. You want a 95 percent confidence interval for the median. The math for median confidence intervals is ugly. Bradley Efron's 1979 insight: just pretend your sample is the population. Sample with replacement 10,000 times, compute the median each time, and use the 2.5th and 97.5th percentiles as your interval. That is the bootstrap.
import numpy as np
data = np.array([45, 52, 60, 61, 67, 72, 78, 85, 92, 120])
def bootstrap_median(data, n_boot=10000):
n = len(data)
medians = np.zeros(n_boot)
for i in range(n_boot):
sample = np.random.choice(data, size=n, replace=True)
medians[i] = np.median(sample)
return medians
boots = bootstrap_median(data)
ci_low, ci_high = np.percentile(boots, [2.5, 97.5])
print(f'Median: {np.median(data):.1f}')
print(f'95% CI: [{ci_low:.1f}, {ci_high:.1f}]')Bootstrap a confidence intervalA permutation test answers: how likely is the observed difference between groups if the labels were random? Shuffle the labels many times, compute the statistic each time, and see where your real statistic falls. It needs no parametric assumptions.
The big idea: when the math gets hard, simulation gets easy. Bootstrap lets you compute uncertainty for almost any statistic with a few lines of code. It is one of the quiet superpowers of modern data analysis.
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-data-bootstrapping
What is the core idea behind "Bootstrapping: Confidence Without a Formula"?
Which term best describes a foundational idea in "Bootstrapping: Confidence Without a Formula"?
A learner studying Bootstrapping: Confidence Without a Formula would need to understand which concept?
Which of these is directly relevant to Bootstrapping: Confidence Without a Formula?
Which of the following is a key point about Bootstrapping: Confidence Without a Formula?
Which of these does NOT belong in a discussion of Bootstrapping: Confidence Without a Formula?
Which statement is accurate regarding Bootstrapping: Confidence Without a Formula?
What is the key insight about "Why it works" in the context of Bootstrapping: Confidence Without a Formula?
What is the key insight about "The small-sample limit" in the context of Bootstrapping: Confidence Without a Formula?
What is the recommended tip about "Ground your practice in fundamentals" in the context of Bootstrapping: Confidence Without a Formula?
Which statement accurately describes an aspect of Bootstrapping: Confidence Without a Formula?
What does working with Bootstrapping: Confidence Without a Formula typically involve?
Which of the following is true about Bootstrapping: Confidence Without a Formula?
Which best describes the scope of "Bootstrapping: Confidence Without a Formula"?
Which section heading best belongs in a lesson about Bootstrapping: Confidence Without a Formula?