Confidence versus prediction intervals: the same data, different questions

Calculate a confidence interval for a mean and a prediction interval for one future value from the same synthetic sample. Includes formulas, code and explicit assumptions.

Read in another language

Published 2026-10-24 · AI-assisted Ithy editorial. Primary references checked 2026-10-24. Original examples are labeled; this is not a named human expert review.

A confidence interval for a population mean estimates the mean. A prediction interval for one future observation must also account for that observation's variability. Under the same simple model and confidence level, the latter is wider. The distinction matters even when both intervals have the same centre.

Which question are you asking?

QuestionInterval
What is the population mean?A confidence interval for the mean
Where might one independent new observation fall?A prediction interval for one observation
Where is the mean of several future observations?A different prediction problem, with its future sample size specified

NIST's discussion of estimating average responses and its single-response prediction discussion explain the distinction in regression. The example below deliberately uses a simpler independent normal-sample model, not a fitted regression.

An original synthetic sample

Use ten invented values in arbitrary units: 8, 9, 9, 10, 10, 10, 11, 11, 12, 10. They are illustrative numbers, not measurements of a real process. Their mean is 10 and their sample standard deviation is approximately 1.154701.

For the worked formulas, assume observations and the future value are independent draws from one unchanged normal distribution with unknown mean and variance. The ten invented values do not prove these assumptions. Real time series, clusters, changing processes or selection effects require a suitable alternative model.

Compute both intervals

With n = 10 and the two-sided 95% Student-t critical value for 9 degrees of freedom, t ≈ 2.262157:

mean confidence interval:
10 ± 2.262157 × 1.154701 / sqrt(10)
≈ [9.1740, 10.8260]

one-observation prediction interval:
10 ± 2.262157 × 1.154701 × sqrt(1 + 1/10)
≈ [7.2604, 12.7396]

The extra 1 inside the prediction square root represents the new observation's variation. More information can narrow uncertainty about a mean without making individual future values identical to that mean. NIST's prediction-limits reference includes the corresponding independent-sample formula and the extension to a future average.

Reproduce the arithmetic

Download the standard-library Python example. The critical value is stated explicitly rather than pretending it was estimated from these data.

from math import sqrt
from statistics import mean, stdev

x = [8, 9, 9, 10, 10, 10, 11, 11, 12, 10]
n, centre, s = len(x), mean(x), stdev(x)
t = 2.2621571627409915  # 0.975 quantile, 9 degrees of freedom
ci = t * s / sqrt(n)
pi = t * s * sqrt(1 + 1/n)
print(tuple(round(v, 4) for v in (centre-ci, centre+ci)))
print(tuple(round(v, 4) for v in (centre-pi, centre+pi)))

Interpretation and common mistakes

For the confidence procedure, the 95% refers to long-run coverage across repeated samples under its assumptions. It is not the proportion of individual observations expected inside the mean's interval. For prediction, the coverage concerns an independent future value under the specified model; it is not a guarantee for every next value.

In regression, the calculation also depends on the predictor value and the fitted model. Do not paste this simple-sample formula onto a regression chart or extrapolate it to an unobserved operating regime. Neither interval automatically includes every source of systematic error.

For the underlying difference between variability and uncertainty about a mean, see standard deviation, standard error and confidence intervals. For misleading aggregate comparisons, see Simpson's paradox with an original dataset.

For a correction, send the specific claim and a supporting source through Ithy Help. Research methodology · More research guides.