Prediction intervals: keep one new case separate from the mean
A regression can estimate the average processing time for documents of a given size quite precisely while leaving substantial uncertainty about the next individual document. Both outputs can share the same fitted value. Their intervals differ because a new case carries its own unexplained variation in addition to uncertainty in the fitted conditional mean.
The deliverable is two clearly labeled intervals at a stated predictor value: one for the conditional population mean and one for a new independent observation. Keep the predictor position, residual variance and treatment of estimated scale visible. A narrow mean interval must not be attached to an individual company or document as though it described that case’s likely outcome.
Specify the conditional target and design
Consider the simple linear model Y = beta0 + beta1 x + epsilon, with an intercept, fixed error-free predictor values and independent normal errors of mean zero and constant variance sigma². The example concerns a research workflow’s completion time, not a security’s price. Assume the future observation comes from the same process and has an error independent of the training data.
NIST’s prediction overview distinguishes uncertainty in an estimated regression function from uncertainty for a new measurement. Its separate pages on the average response and a single new response provide the corresponding interval construction. The numerical design below is an original illustration of those targets.
Let n = 25, predictor mean 10 and Sxx = sum[(xi−10)²] = 100. Suppose the fitted line is yhat=30+2x. For any requested x0, define:
h0 = 1/n + (x0−xbar)²/Sxx.
This leverage quantity measures how the predictor position affects uncertainty in the fitted mean. It is not a probability or an error rate. At the sample predictor mean it is smallest; moving away adds a term even when the requested value is still inside the observed domain.
First isolate the known-sigma case
Assume sigma is independently known to equal 10. The coefficients are still estimated; knowing the error scale does not mean knowing the true regression line. Under the model:
SE(fitted conditional mean) = 10 sqrt(h0).
SD(new observation minus fitted value) = 10 sqrt(1+h0).
The extra 1 represents the new observation’s own residual variance, expressed in units of sigma². Its error is independent of the fitted mean error, so the variances add. Using 1.96 as the rounded 95% normal critical value, compute:
| Requested x0 | Fitted value | h0 | Mean interval | New-observation interval |
|---|---|---|---|---|
| 10 | 50 | 0.04 | [46.080,53.920] | [30.012,69.988] |
| 15 | 60 | 0.29 | [49.445,70.555] | [37.739,82.261] |
At x=10, the mean standard error is 10√0.04=2, so the mean half-width is 3.92. The new-observation error SD is 10√1.04≈10.198, giving half-width 19.988. The same fitted center 50 does not make the two ranges interchangeable.
At x=15, h0=1/25+25/100=0.29. The mean half-width becomes 10.555 and the new-observation half-width 22.261. The larger width reflects less information about the fitted line at that position, not a change in the assumed constant residual SD 10.
Assume x=15 lies in the observed predictor domain. The example therefore does not need extrapolation to show the leverage effect. To make the design summaries reproducible, one feasible predictor set is 5 and 15 once each, eleven copies of 10−sqrt(25/11), eleven copies of 10+sqrt(25/11), and one 10. It has 25 values, mean 10 and Sxx 100. These constructed repeats demonstrate the arithmetic, not a recommendation for an optimal collection design.
Then estimate the scale and use the correct t factor
Most practical regressions estimate residual scale. For the same simple model, there are two fitted coefficients, so the residual degrees of freedom are 25−2=23. If the residual sum of squares is 2300, then s=sqrt(2300/23)=10.
The usual normal-error formulas now use the 97.5th percentile of t23, approximately 2.068658, rather than 1.96:
mean interval = yhat ± t23 × s sqrt(h0);
new-observation interval = yhat ± t23 × s sqrt(1+h0).
At x=10, the mean half-width is 4.137 and the prediction half-width 21.096. The respective intervals are approximately [45.863,54.137] and [28.904,71.096]. The numerically identical scale 10 has a different status here: it is estimated from 23 residual degrees of freedom, not externally known.
Use the model’s residual degrees of freedom, not 25 or 24 by habit. Additional fitted parameters, a different variance model or a different estimation method changes the calculation. A software output labeled “confidence” or “prediction” is not sufficient documentation; verify the target and scale treatment with a small calculation like this one.
Explain what more data can and cannot shrink
If independent observations increase while the design continues to cover the target x, uncertainty in the conditional mean can decline. The new observation retains its own residual variation. In the known-sigma model, as h0 approaches zero, its 95% half-width approaches 1.96×10=19.6 rather than zero.
This is why replacing sqrt(1+h0) with sqrt(h0) can become increasingly misleading as the mean estimate improves. More training data do not make an intrinsically variable new document deterministic. They improve knowledge of the average under the specified conditions.
The target is also not the unconditional mean of all documents. x0 is held fixed. If the predictor itself is measured with error or the future document’s size is uncertain, these formulas omit another source of uncertainty. Record the observed predictor and the quantity it is intended to represent before interpreting the conditional output.
Identify boundaries where the formula does not certify coverage
An algebraic interval can be computed outside the observed domain, but a finite answer does not validate the assumed straight line there. If processing time changes regime for very large documents, a wider leverage term does not repair the wrong mean function. Check the support and plausible mechanism before giving an extrapolated interval a coverage interpretation.
Likewise, heavy tails, changing variance or time-dependent errors challenge the stated normal, constant-variance, independent-error model. Robust coefficient standard errors alone do not supply a predictive residual distribution for a new case. A repeated case sharing a common shock with the training data also needs covariance treatment; the independent new-error variance addition is no longer automatic.
For operational use, evaluate predictions on genuinely held-out cases representative of the intended conditions. Record realized errors by predictor level and period, while recognizing that a small validation set gives imprecise coverage evidence. A point lying within the mean interval is not the relevant validation event for an individual prediction.
Preserve a two-target audit table
| Item | Evidence to record | Action if unresolved |
|---|---|---|
| Target | conditional mean or one new case | withhold an ambiguous interval |
| Design | n, predictor mean, Sxx and domain | recover inputs before recomputing |
| Fitted model | coefficients, residual checks and version | assess misspecification |
| Scale | known sigma or estimated s, SSE and df | do not mix z and t cases |
| New-case assumptions | independence and comparable process | add needed covariance or revise model |
| Validation | held-out errors and coverage by conditions | label limits of deployment evidence |
Resolve conflicting software results by checking whether one program returned a mean interval and another a prediction interval, whether an intercept was included, and whether both used the same x units and residual degrees of freedom. Preserve full-precision intermediate values and round only the final display.
Update the judgment when new cases reveal a variance change, a corrected predictor shifts leverage, the outcome definition changes, or a new fit replaces the old model. Keep the original prediction and date so later observations can test what was actually claimed. Separating the two targets makes that review possible without confusing a precise average with a predictable individual.
A future average is a third, separately defined target
Suppose the operational output is the average of four new independent documents, all at x=10, rather than one new document or the population conditional mean. Under the same known-sigma assumptions, the future average’s residual variance is sigma²/4. Its error relative to the fitted mean therefore has variance sigma²×(h0+1/4), not sigma²×(1+h0)/4.
At h0=0.04, the 95% half-width is 1.96×10×sqrt(0.04+0.25)≈10.555, giving [39.445,60.555] around 50. The fitted-mean estimation error is shared across the four predictions; averaging future residuals does not divide that shared term by four. This target is narrower than the single-case prediction interval but wider than the conditional-mean interval. Name it explicitly if used. Do not treat four copies of the same case, or four cases sharing an unmodeled shock, as the independent future observations assumed in this calculation.
For each issued interval, keep a target label with the saved prediction, not only in a separate methodological note. Otherwise an exported number can lose whether it described an individual or an average. Later coverage checks must match that saved target and observation unit; changing the label after outcomes arrive invalidates the comparison with the original prediction.
FAQ
Why do the two intervals have the same center?
The model’s best fitted value is the same, but a new observation adds its own residual uncertainty. The target, not the center, determines the width.
Can a 95% mean interval be used for one new case?
Not under these formulas. Use the prediction interval with the additional residual term and the appropriate known-scale or estimated-scale critical value.