Confidence Intervals
A confidence interval estimates an unknown mean from a sample. Repeated sampling shows that about 95% of 95% intervals contain the true mean — not 95% of the data.
Each vertical line is one confidence interval. Cyan intervals cover the true mean (amber dashed line); rose intervals miss. About 95% of 95% intervals should cover the mean — coverage is a property of the procedure, not of any single interval.
What you are seeing
Each sample gives a sample mean and standard error. The interval is mean ± z* × SE.
The critical value z* comes from the normal distribution: about 1.96 for 95% confidence.
Coverage is a property of the procedure, not of one interval. About 95% of repeated intervals should contain the true mean.
Why it matters
Confidence intervals quantify uncertainty in polls, clinical trials, A/B tests, and scientific measurements.
Complexity & details
One interval costs O(n) for n observations. Simulating R intervals costs O(Rn).
Frequently asked questions
Does a 95% interval contain 95% of the data?+
No. It estimates the mean. With more data the interval narrows, even though the spread of individual observations may stay the same.
What does 95% confidence mean?+
If we repeated the sampling procedure many times, about 95% of the resulting intervals would contain the true parameter.