Tutorials › Generalized Linear Models › Prediction Intervals for New Gaussian Responses

Gaussian GLMs and Weights · Tutorial 340 of 981

Prediction Intervals for New Gaussian Responses

Learn why predicting a new response requires more uncertainty than estimating its mean, and derive exact Gaussian prediction intervals.

Beginner 11 min read

What You'll Learn

  • Distinguish a prediction interval for one new response from a confidence interval for a mean response
  • Combine fitted-mean uncertainty with the new observation’s residual variance
  • Derive the exact Student \(t\) pivot when dispersion is estimated
  • Construct prediction intervals with known or estimated Gaussian dispersion
  • Adjust the prediction variance for known precision weights
  • Identify common errors in prediction-interval calculations and interpretation

Why Predicting a New Response Requires More Uncertainty

A confidence interval for the mean response at a covariate value \(x_0\) describes uncertainty about \(x_0^\mathsf{T}\beta\). A prediction interval asks a different question: where might one new response at \(x_0\) fall? Even if the mean were known exactly, a new Gaussian response would still vary around it. A prediction interval must account for both that variation and the uncertainty in estimating the mean.

We work with the identity-link Gaussian model and a fixed design matrix. The covariate vector \(x_0\) is treated as fixed, or the calculation is understood conditionally on its value. The interval is pointwise: it targets one specified \(x_0\), not simultaneous coverage over many covariate values.

Definition: A \(100(1-\alpha)\%\) prediction interval for a new response \(Y_0\) at \(x_0\) is a random interval, calculated from the observed data, that contains \(Y_0\) with probability \(1-\alpha\) under the stated model and repeated sampling. A prediction interval concerns an individual future response; an interval for the mean concerns \(x_0^\mathsf{T}\beta\).

Model and Prediction Variance

Let \(Y=(Y_1,\ldots,Y_n)^\mathsf{T}\) follow the Gaussian regression model

$$ Y\sim N(X\beta,\sigma^2 W^{-1}), $$

where \(X\) is a fixed \(n\times p\) design matrix of full column rank, \(n>p\), \(\beta\) is a \(p\)-vector, \(\sigma^2>0\) is the dispersion, and \(W=\operatorname{diag}(w_1,\ldots,w_n)\) has known positive precision weights. Thus, conditionally on the design, \(Y_i\) has variance \(\sigma^2/w_i\). The unweighted model is the special case \(w_i=1\) for every observation.

The weighted least-squares estimator and residual sum of squares are

$$ \hat{\beta}=(X^\mathsf{T}WX)^{-1}X^\mathsf{T}WY,\qquad Q=(Y-X\hat{\beta})^\mathsf{T}W(Y-X\hat{\beta}). $$

For a specified new covariate vector \(x_0\), suppose \(Y_0\) is independent of the observed responses and follows \(N(x_0^\mathsf{T}\beta,\sigma^2/w_0)\), where \(w_0>0\) is its known precision weight. Write

$$ h_0=x_0^\mathsf{T}(X^\mathsf{T}WX)^{-1}x_0. $$

The fitted mean \(x_0^\mathsf{T}\hat{\beta}\) has variance \(\sigma^2h_0\). The new response contributes a separate variance \(\sigma^2/w_0\). Because the new response and the fitted mean are independent, their difference has variance \(\sigma^2(h_0+1/w_0)\).

Key variance formula: The prediction error \(Y_0-x_0^\mathsf{T}\hat{\beta}\) has variance \(\sigma^2(h_0+1/w_0)\). The \(h_0\) term is uncertainty in the estimated mean; the \(1/w_0\) term is the new response’s residual variance in units of dispersion.

Exact Prediction Intervals

If \(\sigma^2\) is known, the prediction error is normal, so a standard normal quantile gives an exact interval. In most applications \(\sigma^2\) is estimated. For an exact finite-sample Student \(t\) interval, use the degrees-of-freedom-corrected residual variance estimate

$$ s^2=\frac{Q}{n-p}. $$

The maximum-likelihood estimate \(Q/n\) is not the estimate used in this exact \(t\) pivot: its scaled form does not have the required chi-square degrees of freedom.

Theorem: Under the Gaussian model above, with fixed full-rank \(X\), known positive weights, independent \(Y_0\), and \(n>p\), the statistic
$$ \frac{Y_0-x_0^\mathsf{T}\hat{\beta}}{s\sqrt{h_0+1/w_0}} $$

has a Student \(t\) distribution with \(n-p\) degrees of freedom. Consequently, an exact \(100(1-\alpha)\%\) prediction interval is

$$ x_0^\mathsf{T}\hat{\beta}\ \mathbin{\pm}\ t_{1-\alpha/2,\,n-p}\,s\sqrt{h_0+1/w_0}, $$

where \(t_{1-\alpha/2,\,n-p}\) is the \(1-\alpha/2\) quantile of the \(t\) distribution with \(n-p\) degrees of freedom.

Proof. Let \(A=W^{1/2}X\) and \(Z=W^{1/2}Y\). Then \(Z\sim N(A\beta,\sigma^2I)\), and the projection matrix onto the column space of \(A\) is \(P=A(A^\mathsf{T}A)^{-1}A^\mathsf{T}\). The residual sum of squares is \(Q=Z^\mathsf{T}(I-P)Z\). Since \(I-P\) is an idempotent matrix of rank \(n-p\), the normal projection result gives \(Q/\sigma^2\sim\chi^2_{n-p}\). The fitted coefficient is a linear function of \(Z\), while the residual vector is its orthogonal projection onto the column space’s complement. These projections of a multivariate normal vector are independent; therefore \(\hat{\beta}\) and \(Q\) are independent.

The estimation error \(x_0^\mathsf{T}\hat{\beta}-x_0^\mathsf{T}\beta\) is normal with mean zero and variance \(\sigma^2h_0\). Independently, \(Y_0-x_0^\mathsf{T}\beta\) is normal with mean zero and variance \(\sigma^2/w_0\). Their difference \(Y_0-x_0^\mathsf{T}\hat{\beta}\) is therefore normal with mean zero and variance \(\sigma^2(h_0+1/w_0)\). It is independent of \(Q\), because the future response is independent of the observed data and the fitted-mean error is independent of \(Q\). Finally, \(s^2/\sigma^2=(Q/\sigma^2)/(n-p)\). Dividing the standard normal prediction error by the square root of this independent chi-square quantity divided by its degrees of freedom gives a \(t_{n-p}\) variable. Inverting its central probability statement gives the displayed interval. \(\square\)

When \(\sigma^2\) is known, the same normal prediction error directly gives the exact interval

$$ x_0^\mathsf{T}\hat{\beta}\ \mathbin{\pm}\ z_{1-\alpha/2}\,\sigma\sqrt{h_0+1/w_0}, $$

where \(z_{1-\alpha/2}\) is the standard normal quantile. This is a separate result from the \(t\) interval: replacing \(s\) by a known \(\sigma\) removes the extra uncertainty due to estimating dispersion.

Worked Calculations

Worked Example: Prediction in an Intercept-Only Model

Suppose \(n=5\) independent observations share a common Gaussian mean, with observed sample mean \(\bar{Y}=14\) and residual sum of squares \(Q=20\). Find a 95% prediction interval for one new observation with the same precision as the observed data.

In the intercept-only model, \(p=1\), \(x_0=1\), and \(X^\mathsf{T}X=5\). Thus \(h_0=1/5=0.2\), and \(w_0=1\). The residual variance estimate is \(s^2=20/(5-1)=5\). The prediction standard error is

$$ s\sqrt{h_0+1/w_0}=\sqrt{5(0.2+1)}=\sqrt{6}\approx2.449. $$

With 4 degrees of freedom, \(t_{0.975,4}\approx2.776\). The margin of error is \(2.776\sqrt{6}\approx6.80\), so the 95% prediction interval is \(14\pm6.80\), or approximately \([7.20,20.80]\). The interval is wider than an interval for the common mean because it includes the new observation’s own variability.

Worked Example: Known Dispersion in an Intercept-Only Model

Two independent observations have values 3 and 4, so the fitted mean is \(\bar{Y}=3.5\). Suppose the Gaussian dispersion is known to be \(\sigma^2=2\), and predict a new response with precision weight \(w_0=1\). Here \(h_0=1/2\), so the prediction variance is

$$ \sigma^2(h_0+1/w_0)=2(1/2+1)=3. $$

Using \(z_{0.975}=1.96\), the 95% prediction interval is \(3.5\pm1.96\sqrt{3}\). Since \(1.96\sqrt{3}\approx3.3948\), its endpoints are approximately \(3.5-3.3948=0.1052\) and \(3.5+3.3948=6.8948\). Thus the interval is \([0.1052,6.8948]\). The calculation uses the normal quantile because dispersion is known; it does not use a \(t\) quantile.

Worked Example: A New Response with a Different Precision Weight

Consider an intercept-only weighted model with responses \(8,10,12\) and observed precision weights \(1,2,1\). The weighted fitted mean is

$$ \hat{\beta}=\frac{1(8)+2(10)+1(12)}{1+2+1}=10. $$

The weighted residual sum of squares is \(Q=1(8-10)^2+2(10-10)^2+1(12-10)^2=8\). With \(n=3\) and \(p=1\), \(s^2=8/2=4\). The new response has precision weight \(w_0=2\), while \(h_0=1/(1+2+1)=1/4\). Therefore, the prediction standard error is

$$ s\sqrt{h_0+1/w_0}=2\sqrt{1/4+1/2}=2\sqrt{3/4}=\sqrt{3}\approx1.732. $$

For a 95% interval with \(n-p=2\) degrees of freedom, \(t_{0.975,2}\approx4.303\). The margin is \(4.303\sqrt{3}\approx7.452\), giving the prediction interval \(10\pm7.452\), or approximately \([2.548,17.452]\). The new response’s higher precision reduces its residual-variance contribution from 1 to \(1/2\); it does not remove the uncertainty \(h_0=1/4\) in the estimated mean.

Common Mistake and Interpretation

A frequent error is to use only the standard error for the fitted mean, \(s\sqrt{h_0}\), when predicting a new response. That quantity reflects uncertainty in \(x_0^\mathsf{T}\hat{\beta}\), but it omits the new response’s residual variance. The correct prediction standard error is \(s\sqrt{h_0+1/w_0}\). In an unweighted model, this becomes \(s\sqrt{h_0+1}\); omitting the 1 can make a prediction interval much too narrow.

The reverse mistake is to use the response variance alone and omit \(h_0\). That treats the fitted mean as if it were known. Both sources of uncertainty belong in the interval. A useful check is that \(h_0\geq0\), so the prediction standard error is at least as large as the new response’s residual standard deviation when dispersion is known. Prediction intervals also need not stay within a scientifically plausible range; their coverage claim follows from the Gaussian model, not from any extra restriction on response values.

These are model-based intervals for a single specified covariate vector. They do not automatically account for uncertainty in the covariates, model selection, or simultaneous prediction at multiple values of \(x_0\). Their exact \(t\) coverage relies on Gaussian errors, the stated variance structure, known precision weights, and the full-rank fixed-design assumptions used in the derivation.

Check Your Understanding

Use the formulas and assumptions above to answer the following.

  1. In an unweighted Gaussian model, which two contributions make up the variance of \(Y_0-x_0^\mathsf{T}\hat{\beta}\)?
  2. Why does a prediction interval for one response usually have a larger standard error than a confidence interval for its mean?
  3. For a weighted model, how does increasing the new observation’s precision weight \(w_0\) change the prediction variance contribution from its residual variation?
  4. Why is \(Q/(n-p)\), rather than \(Q/n\), used in the exact Student \(t\) prediction interval?
  5. What assumptions are needed for the prediction statistic in the theorem to have an exact \(t_{n-p}\) distribution?
Clinical Biostats