Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.A net, not a point
Your best guess for a robot’s average battery life is 37.2 hours. But your guess came from a limited test, so the truth is probably near 37.2, not exactly there. A confidence interval gives a range instead: “between 36.2 and 38.2 hours”. The method is designed so that if you repeated the whole test many times, 95% of the ranges you built would catch the true value.
Think of throwing a net. The fish (the truth) doesn’t move. Your net lands in a slightly different place each time, and a good net catches the fish 95% of the time.
“The new controller reduced tracking error by 12%” means little without an interval: is it 12% ± 2% or 12% ± 30%? Intervals also answer certification questions: after 1000 failure-free test flights, how sure are you that the failure rate is below 1 in 300?
- 1. A 95% confidence interval method…
- 2. More data usually makes the interval…
- 3. In the net analogy, what moves from experiment to experiment?
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.The basic recipe: estimate ± critical value × SE
- Mean, σ known: , with for 90/95/99%.
- Mean, σ unknown (normal data): . For , , not 1.96 (A5.1-2).
- Proportion (large n, p not near 0 or 1): .
- Difference of means: (Welch).
What “95%” means
It’s a property of the procedure, not of one computed interval. After you compute [36.2, 38.2], the truth is either in it or not. There’s no 95% probability attached to this particular interval (that’s the Bayesian credible interval’s job, A5.2-1). Over many repetitions, 95% of such intervals cover.
Sample size for a target width
The half-width is , so . Halving the width needs 4× the data.
- 1. x̄ = 37.2, σ = 4, n = 64: the 95% z-interval half-width is…
- 2. With n = 5 and estimated σ, the multiplier should be…
- 3. To halve an interval's width you need…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Proportions done right
The Wald interval under-covers badly for small or near 0 or 1. With 0 successes it collapses to the single point [0, 0]. With and , its actual coverage is about 87% (Brown, Cai and DasGupta, 2001).
- Wilson: invert the score test, i.e. solve for . Centre . Coverage is close to nominal, even at small .
- Clopper–Pearson (“exact”): invert the binomial test. Its bounds are beta quantiles. It’s guaranteed to cover , but it’s conservative.
Pivots and test inversion
A pivot is a function of the data and the parameter whose distribution doesn’t depend on the parameter. Examples: and . Solving for the parameter gives an interval. For the variance it’s : asymmetric, and wide for small .
More generally, a 95% interval is the set of parameter values that a 5%-level test would not reject. Every test gives an interval, and vice versa (A5.1-7).
- 1. With 0 successes in 20 trials, the Wald 95% interval is…
- 2. The Wilson interval comes from inverting…
- 3. A 95% interval contains exactly the values that a 5% test…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Proof that the t interval has exact coverage
For normal data, whatever and are (A5.1-2). So
Rearranging the inequalities for gives . ∎ The randomness is in and , not in .
Clopper–Pearson and the beta–binomial identity
, the regularized incomplete beta function. The lower bound is the at which observing successes has probability : the quantile of . The upper bound is symmetric. Because the binomial is discrete, the coverage is , never exactly equal.
Zero failures: the rule of three
With 0 failures in trials, the one-sided 95% upper bound solves . So . To demonstrate at 95% takes 2995 failure-free trials. This is why proving high reliability purely by testing is so expensive, and why autonomous-vehicle safety can’t be shown by miles driven alone (Kalra and Paddock, 2016).
Exercise 3.1: Derive the Wilson interval
Square to get a quadratic in : . Its roots are .
- 1. A pivot's distribution depends on…
- 2. Clopper–Pearson coverage is…
- 3. 0 failures in 600 trials: approximate 95% upper bound on p?
Level 4: Expert
★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.Certifying reliability from failure-free tests
A deployment requirement says “failure probability below 0.1% per mission, demonstrated at 95% confidence.” If testing is the only evidence, you need 2995 consecutive clean missions, or 4742 if one failure is allowed. The bound is tight: a system whose true rate equals the bound shows zero failures exactly 5% of the time. In practice, engineers combine testing with other evidence: physics-based analysis, simulation with importance sampling (A4.3-1), Bayesian priors from similar systems (A5.2), and accelerated life testing.
Confidence intervals in AI, robotics and aerospace
- Reporting ML results. Intervals over seeds, or bootstrap intervals over test examples (A5.1-11), should accompany every benchmark number. Agarwal et al. (2021) show how often RL conclusions flip once intervals are drawn.
- Safety validation of autonomous vehicles. Kalra and Paddock (2016) compute that hundreds of millions of miles would be needed to demonstrate fatality rates statistically. That’s why scenario-based and simulation-based validation exist.
- Navigation accuracy. Covariance-based confidence ellipses (for example 2σ, 95%) are reported for GNSS and INS solutions. Their validity depends on the filter being consistent (NEES tests, A5.1-7).
- Uncertainty for predictions. Prediction intervals (for a new observation) are wider than confidence intervals (for a mean). Conformal prediction gives distribution-free prediction intervals (A4.3-6).
- Sequential monitoring. Confidence sequences stay valid when you look at the data repeatedly (A4.4-7).
References
- J. Neyman (1937). “Outline of a theory of statistical estimation based on the classical theory of probability.” Phil. Trans. R. Soc. A, 236.
- E. B. Wilson (1927). “Probable inference, the law of succession, and statistical inference.” JASA, 22(158).
- C. Clopper, E. Pearson (1934). “The use of confidence or fiducial limits illustrated in the case of the binomial.” Biometrika, 26(4).
- L. Brown, T. Cai, A. DasGupta (2001). “Interval estimation for a binomial proportion.” Statistical Science, 16(2).
- J. Hanley, A. Lippman-Hand (1983). “If nothing goes wrong, is everything all right? Interpreting zero numerators.” JAMA, 249(13).
- N. Kalra, S. Paddock (2016). Driving to Safety: How Many Miles of Driving Would It Take to Demonstrate Autonomous Vehicle Reliability? RAND RR-1478.
- B. L. Welch (1947). “The generalization of ‘Student’s’ problem when several different population variances are involved.” Biometrika, 34.
- G. Casella, R. Berger (2002). Statistical Inference, 2nd ed., Ch. 9. Duxbury.
- R. Agarwal et al. (2021). “Deep reinforcement learning at the edge of the statistical precipice.” NeurIPS.
- Y. Bar-Shalom, X. R. Li, T. Kirubarajan (2001). Estimation with Applications to Tracking and Navigation, Ch. 5. Wiley.