Put uncertainty to workLesson 17 of 30 · 7 min
Ninety-five out of what?
Distinguish confidence-procedure coverage from the behaviour of an individual interval.
The previous interval came from one sample. To see the meaning of coverage, repeat the entire sampling-and-interval procedure from a population whose mean you know.
The simulation draws independent normal samples with population mean 100 ms. Each sample creates a new 95% t interval. An interval covers when its lower end is no greater than 100 and its upper end is no less. A miss does not by itself show the implementation is broken; misses are part of the procedure.
The fraction covering 100 fluctuates because the simulation itself is finite. The plot shows only the first thirty intervals; colour and an x marker identify misses. Increasing simulation count estimates the method's coverage more precisely under this model. It does not validate the model for your measurements.
Would you expect every interval in the first 30 to contain the true mean?
Write a prediction (optional)
Run the prepared example
This page puts the example in the Python editor. Select Run Python with the code unchanged.
Seeded simulation
A saved draft is open. To run the published example, open Editor tools and select Restore example. Recover draft brings your code back.
Execution error
Technical error details
What to compare
Find Coverage fraction and Mean interval width (ms). The plot shows the first 30 intervals. Is the fraction based on those 30 or the full count in Intervals?
Your result
Result tools
The fraction counts all 500 samples. The first 30 in this seeded plot happen to cover the true mean. The reference illustration deliberately selects examples of both outcomes, so it cannot show how often they occur.
Published example output
The site ran the original code to produce this reference. Build environment ↗
Confidence level: 95% Intervals: 500 Covering true mean: 480 Coverage fraction: 0.96 Mean interval width (ms): 18.76
The fraction counts all 500 samples. The first 30 in this seeded plot happen to cover the true mean. The reference illustration deliberately selects examples of both outcomes, so it cannot show how often they occur.
Change and run again
Change confidence_level from 0.95 to 0.99 and select Run Python again. Compare Coverage fraction and Mean interval width (ms) with the first run. Both runs use the same seeded samples. Return to the Python editor
What this example supports. The demonstration uses independent normal sampling, where the t procedure has its stated coverage. It says nothing about biased sampling or correlated measurements.
Try a fresh case
You run 100 valid experiments using a 95% confidence procedure. Must exactly 95 intervals cover the mean?
Hints for this question
- Think of another repeated random count, such as coin tosses.
- Separate an expected proportion from an exact count.