Why One Prediction-Interval Width May Not Fit Every Profile
A prediction interval is meant to describe a new individual outcome at specified predictor values. Its width should reflect how much that outcome can vary at those values, as well as uncertainty in the fitted mean. If the outcome’s error spread changes across the predictor range, a single residual standard deviation can hide important differences: intervals may be too wide where outcomes are stable and too narrow where they are variable.
For example, suppose a regression predicts daily energy use from outdoor temperature. The residuals might be tightly clustered at moderate temperatures but much more spread out at very low or very high temperatures. A prediction interval using one pooled error standard deviation gives the same error contribution at all temperatures. That is not a good description of the conditional uncertainty if the error spread genuinely changes with temperature.
This tutorial focuses on how unequal error variance changes prediction intervals and how residual patterns can help assess that change. It does not mean that every visible difference in residual spread proves heteroskedasticity. A residual plot is evidence to inspect, not a substitute for understanding the data and model.
What Changes in the Prediction-Error Variance?
At predictor profile \(x_0\), a new outcome can be written as its conditional mean plus a new error. A prediction error compares that outcome with the fitted mean. Its uncertainty has two sources: the new outcome’s error and the estimation error in the fitted mean. If these are independent conditional on the observed predictors, their variances add.
The first term is the conditional variance of a new individual error. Under equal error variance, the usual prediction-interval formula uses one estimate of that variance for every profile. Under unequal variance, the first term must instead represent the error spread at \(x_0\). The second term concerns uncertainty in estimating the mean at that profile; it also depends on the predictor values and the observed design.
In a simple linear regression with equal error variance, the familiar estimated prediction-error standard error has the form \(s\sqrt{1+h_0}\), where \(s\) is the pooled residual standard deviation and \(h_0\) describes the uncertainty in the fitted mean at \(x_0\). The “1” represents the new individual error. With unequal variance, replacing \(s^2\) by one pooled value is generally inappropriate for that new-error contribution. The estimation uncertainty of the fitted mean also requires care: the usual equal-variance calculation need not describe it correctly when residual variances differ across observations.
Reading Residual Spread Across Predictor Values
A useful first check is a residual-versus-fitted plot or a plot of residuals against an important predictor. Under a constant-variance model, residuals should have roughly similar vertical spread across the range. A fan or funnel shape, or a noticeably wider cloud in one region, suggests that the error spread may vary. The sign of residuals concerns whether predictions tend to be high or low; their spread concerns the size of the deviations. These are different features of the plot.
Residuals are not the unobserved errors themselves: they are calculated after estimating the regression. Their spread can also be affected by predictor location and leverage, as discussed in earlier material on prediction-interval width. Therefore, compare residual patterns with those features in mind. Look for a persistent change in spread across a meaningful range or across substantively defined profiles, rather than reacting to one unusually large residual.
Identify the predictor values or groups where the prediction will be made, and examine residuals across the observed range.
Ask whether the typical distance of residuals from zero changes across profiles. A trend in residual signs raises a different concern than a change in their dispersion.
If the spread changes systematically, do not interpret one pooled residual standard deviation as the error scale for every new case.
Where suitable new outcomes are available, compare the fraction covered in low- and high-spread regions. A satisfactory overall fraction can mask poor coverage in one region.
Worked Example: Comparing Residual Spread in Two Regions
Suppose a hypothetical regression produces six residuals in a low-predictor region: \(-3, 2, -2, 3, -1, 1\) units. In a high-predictor region, the six residuals are \(-10, 12, 5, -14, 8, 2\) units. Compare their sample standard deviations as a descriptive check.
For the low region, the residual mean is zero. The sum of squared deviations is \[ (-3)^2+2^2+(-2)^2+3^2+(-1)^2+1^2=28. \] Thus the sample variance is \(28/(6-1)=5.6\) square units, and the sample standard deviation is \(\sqrt{5.6}=2.366\) units.
For the high region, the residual mean is \(({-10}+12+5-14+8+2)/6=0.5\) units. The squared deviations from that mean sum to \[ (-10.5)^2+11.5^2+4.5^2+(-14.5)^2+7.5^2+1.5^2=531.5. \] The sample variance is \(531.5/5=106.3\) square units, and the sample standard deviation is \(\sqrt{106.3}=10.31\) units.
The high-region residual standard deviation is much larger than the low-region value. This pattern is consistent with greater error variation at higher predictor values. It is not conclusive by itself: each estimate uses only six residuals, and the residuals are estimated rather than the unobserved errors. Still, using one pooled spread as if both regions had the same conditional variability would obscure this difference.
Conditional Widths: An Illustrative Calculation
A conditional interval needs an estimate of the error variance appropriate to the prediction profile, along with an allowance for uncertainty in the fitted mean. A suitable procedure for estimating these quantities depends on the regression setting; the calculation below is only an illustration of how variance components affect width. It is not an exact, generally calibrated \(t\)-interval under heteroskedasticity.
For a transparent comparison, suppose the local residual variances from the previous example are used as estimates of \(\sigma^2(x_0)\), and suppose the estimated variance of the fitted mean is \(2.25\) square units at each of two profiles. Use a multiplier of \(1.96\) just to illustrate a normal-based plug-in width. The half-width is the multiplier times the square root of the sum of the two estimated variance components.
Worked Example: Calculating Two Illustrative Interval Widths
Suppose the fitted mean is 40 units in the low-spread region and 70 units in the high-spread region. Use local error-variance estimates \(5.6\) and \(106.3\) square units, respectively, and a fitted-mean variance of \(2.25\) square units for each profile.
Low-spread profile. The estimated prediction-error standard deviation is \[ \sqrt{5.6+2.25}=\sqrt{7.85}=2.802\text{ units}. \] The illustrative half-width is \(1.96(2.802)=5.491\) units. The resulting interval is \(40\pm5.491\), or approximately \((34.51,\ 45.49)\) units.
High-spread profile. The estimated prediction-error standard deviation is \[ \sqrt{106.3+2.25}=\sqrt{108.55}=10.42\text{ units}. \] The illustrative half-width is \(1.96(10.42)=20.42\) units. The resulting interval is \(70\pm20.42\), or approximately \((49.58,\ 90.42)\) units.
The much wider interval for the high-spread profile follows from its larger estimated conditional error variance. These endpoints illustrate the width calculation only. The local variances are based on small residual groups, and the multiplier does not establish a nominal coverage level; a valid inferential procedure must account for how the variance and mean uncertainty are estimated.
Coverage Should Be Examined Conditionally
A prediction interval’s coverage is the long-run proportion of new outcomes that fall inside intervals constructed by the procedure under its assumptions. With heteroskedasticity, the relevant question is not only whether coverage is close to its target overall, but also whether it is adequate for different predictor profiles. A pooled result can average together overcoverage in one region and undercoverage in another.
For a simple coverage check, take a collection of prediction errors in a region and count how many fall within the interval half-width used there. This observed fraction is descriptive; a small collection is noisy and does not prove the procedure’s long-run coverage. In particular, a symmetric interval with half-width \(c\) covers an error \(e\) exactly when \(|e|\le c\).
Worked Example: Checking Coverage in Low- and High-Spread Regions
Suppose a hypothetical check uses a half-width of \(11.76\) units in both regions. The six low-region prediction errors are \(-4, 3, -2, 1, 0,\) and \(5\) units. The six high-region errors are \(-10, 12, 5, -14, 8,\) and \(2\) units. Count the errors covered in each region.
In the low region, all six absolute errors are at most \(11.76\), so the observed fraction covered is \(6/6=1\), or \(100\%\).
In the high region, the errors \(-10, 5, 8,\) and \(2\) units have absolute values at most \(11.76\). The errors \(12\) and \(-14\) units are outside because \(12>11.76\) and \(14>11.76\). Therefore, four of the six high-region errors are covered, and the observed fraction is \(4/6=0.667\), or \(66.7\%\).
These small-sample fractions do not establish the true coverage rates. They do show why regional checks matter: the same half-width covered all six low-region errors but only four high-region errors in this hypothetical set. If a procedure is intended to give a particular coverage level across profiles, its performance should not be judged solely by a pooled fraction.
Assumptions, Interpretation, and a Common Pitfall
The variance comparison and interval reasoning assume that the conditional mean model is suitable for the profiles being considered, observations provide relevant information for estimating the conditional variability, and the future outcome follows the same conditional process as the data used to fit the model. A normal-based interval additionally relies on an appropriate conditional error distribution or on an approximation adequate for the purpose. Unequal variance alone does not guarantee that a particular plug-in interval has correct coverage.
The practical implication is that interval construction must account for local error spread rather than automatically reusing a single residual standard deviation. One may need an approach that estimates or models conditional variance and correctly quantifies uncertainty in both the fitted mean and the new outcome. The exact method depends on the data and design; a visual pattern alone does not supply a calibrated interval.
- Common mistake: “The pooled residual standard deviation is calculated from all observations, so it is the right error spread for every prediction.”
- Why it fails: Pooling averages information across profiles. If the error variance changes with predictors, that one number may overstate variability in a stable region and understate it in a variable region.
- Correction: Inspect residual spread across the predictor range, distinguish new-outcome variability from fitted-mean uncertainty, and assess widths and coverage conditionally when possible.
Check Your Understanding
Use the definitions and examples above to answer the following questions.
- In a regression with larger residual spread at high predictor values, which component of prediction uncertainty directly changes across profiles: new-outcome error variance, fitted mean, or both?
- Why is a residual-versus-fitted plot with a widening vertical spread relevant to prediction intervals?
- A prediction error is \(13\) units and the interval half-width is \(12\) units. Is the error covered? State the comparison that determines your answer.
- Why might an overall observed coverage fraction conceal poor coverage in one predictor region?
- In the illustrative interval calculation, why was the wider high-region interval not sufficient evidence of exact 95% coverage?