Confidence Intervals
A single number hides its own uncertainty. Reporting that the mean failure time is 649 CPU seconds says nothing about whether the truth is plausibly 600 or plausibly 400. A confidence interval reports a range together with a statement about how often that procedure captures the parameter.
Definition. Let . The interval , where and , is a confidence interval for if the corresponding random variables and satisfy for every value of . If , the interval is conservative.
is the confidence level, is the significance level.
Which symbols are random is the whole subject and it is examined directly.
- Random: and , because they are functions of the random sample.
- Not random: , which is a fixed unknown constant; , which you chose; and , which are numbers computed from data already in hand.
1. The pivot
Constructing an interval means finding a quantity whose distribution is known even though is not.
Definition. A pivot is a random variable that (1) depends only on the random sample and the parameter of interest , and not on any other parameter, and (2) has a distribution that does not depend on or on any other unknown parameter.
The two conditions do different work. The first makes the only unknown in the expression, so it can be isolated. The second makes the probability statement usable, since a distribution depending on the unknown could not supply numerical quantiles.
The standard pivot for a normal mean with known variance is
It contains and and nothing else unknown, and its distribution is standard normal regardless of what is.
Critical values
Definition. is the critical value of the standard normal satisfying . Equivalently is the th quantile. By symmetry, .
For a 95% interval, and is the 0.975 quantile, which is qnorm(0.975) , usually written 1.96.
2. Inversion: turning a probability statement into an interval
The derivation below is the one to be able to reproduce. Every interval in the course is this argument with a different pivot.
Start from the pivot and its known distribution. By construction, the middle of a standard normal lies between and :
Now isolate inside the inequality, one operation at a time.
Multiply through by , which is positive so the inequalities are unchanged:
Subtract throughout:
Multiply by , which reverses both inequalities:
Comparing with the definition, and . Substituting the observed gives the realized interval
Sign-flipping on the multiplication by is where this derivation is usually lost. For a symmetric pivot the two errors cancel and the answer still looks right, which is why it survives; for the chi-squared pivot below it does not.
3. The four intervals for a mean
Which construction applies depends on what you know. The decision is a two-question tree: is the data normal, and is known.
Chebyshev, when nothing is known about the shape
Applicable to any distribution with finite mean and variance. Recall Chebyshev’s inequality: .
Applied to , which has mean and variance :
Set the right side to and solve for .
Worked example: a conservative 80% interval. Set , so and
giving the interval
The statement is that we are at least 80% confident, since Chebyshev gives an inequality rather than an equality. That is what makes it conservative: the true coverage is at least the stated level and usually much more, so the interval is wider than necessary.
Normal data, known variance
The construction derived above:
Normal data, unknown variance
is almost never known. Replacing it with the sample standard deviation puts a random quantity in the denominator, so the pivot is no longer standard normal:
This is the studentized mean, as against the standardized mean which divides by the known . The extra randomness makes the distribution more spread out than a normal, so the correct critical values come from :
Because has heavier tails than the normal, , so the interval is wider. That extra width is the price of not knowing , and the effect vanishes as grows.
The interval depends on neither the mean nor the variance of the data-generating distribution, which is what makes it computable.
Large sample, unknown distribution
If the data are not normal but is large, the central limit theorem gives
approximately, so
is an approximate interval. Note the combination: in place of , but the normal critical value rather than the one, because the justification here is the central limit theorem rather than an exact distributional result.
The fifth case, a small sample from an unknown distribution, is the bootstrap.
The comparison, on one data set
100 simulated observations from , with :
| Method | 95% interval | Width |
|---|---|---|
| Normal, known | 0.392 | |
| , unknown | 0.417 | |
| CLT with | 0.412 | |
| Bootstrap | 0.429 |
Every interval that estimates the variance is wider than the one that knows it. Uncertainty about propagates into uncertainty about .
4. Interpretation
This is the most-tested conceptual point in the course, and the tempting reading is wrong.
The correct statement. Before the data are seen, and are random and is fixed, so
is a genuine probability statement about a random interval. Its meaning is a frequency across repeated sampling: 95% of all possible samples of size yield an interval containing the true , and 5% yield one that does not.
Why the realized interval is different. Once you compute and , nothing in the statement "" is random. is a fixed constant and so are 2 and 5. The statement is either true or false, and no probability attaches to it. You cannot know which, but that is ignorance, not randomness.
So these are all wrong for a realized interval :
- “95% of all samples will yield a sample mean between 2 and 5.”
- “The true mean is between 2 and 5 with 95% probability.”
- “There is a 95% chance the true mean is between 2 and 5.”
- “There is a 95% chance that the interval 2 to 5 includes the true mean.”
Statement 1 confuses the distribution of with the distribution of . Statements 2 and 3 assign a probability to a fixed constant. Statement 4 is the subtle one: moving the “chance” onto the interval does not help, because the realized interval is also fixed.
The approved form uses the word confidence rather than probability: we are 95% confident that the true value of lies between and . The confidence attaches to the procedure, not to the particular numbers it produced.
Fifty simulated 95% intervals from data illustrate it: each interval either contains 0 or does not, and roughly two or three of the fifty miss.
5. Sample size and precision
appears in every interval through in the denominator, so wider samples give narrower intervals. The width shrinks like , so quartering the width takes sixteen times the data.
What more data does not buy is coverage. The probability that the interval misses is regardless of . A 95% interval computed from a million observations is extremely narrow and still misses 5% of the time. Precision and coverage are separate knobs, and only precision responds to sample size.
6. Worked example: an interval for a standard deviation
The machinery is not restricted to means. Any pivot supports the same inversion.
Speed of light measurements, , modelled as with both unknown, and we want a 95% interval for .
There is no simple distribution for itself, but there is one for a function of it:
which is a pivot: it contains only the sample and , and its distribution depends on neither.
The chi-squared distribution is not symmetric, so the two critical values must be looked up separately rather than differing by a sign:
qchisq(0.025, n - 1) # 73.36108
qchisq(0.975, n - 1) # 128.422Inverting for requires taking reciprocals, which reverses the inequalities and swaps which critical value goes where:
With :
sqrt((n - 1) / c(c_u, c_l)) * s_n # 69.3718 91.7846The interval is , and is not at its centre, because the chi-squared distribution is skewed. Any interval built on a non-symmetric pivot is asymmetric about the estimate.
Vocabulary to deploy
- Confidence interval, confidence level , significance level .
- Conservative interval: coverage at least .
- Pivot: depends only on the sample and , with a distribution free of unknowns.
- Inversion: rearranging a probability statement about a pivot to isolate .
- Critical value , ; standard error, the standard deviation of an estimator.
- Standardization (divide by ) against studentization (divide by ).
- Coverage against precision: buys precision only.