01 / 21

Forecasting &
Prediction Intervals

Learn how to project future values from regression models and quantify the uncertainty surrounding individual predictions using prediction intervals.

Statistics

What Is Forecasting?

Forecasting uses a fitted model to estimate future or unobserved values of a response variable. Given a regression equation \( \hat{y} = b_0 + b_1 x \), we substitute a new value of \( x \) to obtain a point forecast \( \hat{y} \).

Interpolation
Predicting within the range of observed \( x \) values
Extrapolation
Predicting beyond the range: riskier and less reliable

Two Sources of Uncertainty

When we make a prediction, two distinct sources of variability contribute to our uncertainty about where the actual observation will land.

1. Estimation Uncertainty
Our regression line \( \hat{y} = b_0 + b_1 x \) is an estimate of the true line \( \mu_Y = \beta_0 + \beta_1 x \). The coefficients \( b_0, b_1 \) vary from sample to sample.
2. Individual Variability
Even if we knew the true line exactly, individual observations scatter around it with variance \( \sigma^2 \). This irreducible noise affects each new \( Y \).

Visualizing the Two Bands

\(x\) \(y\) \(\bar{x}\) Regression line Confidence band (mean) Prediction band

Why Prediction Intervals Matter

A point forecast tells us the most likely value, but stakeholders need to know the range of plausible outcomes before making decisions. Prediction intervals communicate that range honestly.

1
Risk assessment: A manufacturer predicting tomorrow's demand needs to know worst-case and best-case, not just the average.
2
Anomaly detection: An observation falling outside the prediction interval may signal an unusual event or model failure.
3
Model honesty: Reporting intervals forces us to confront how much we really don't know.

The Prediction Interval Formula

$$ \hat{y} \;\pm\; t_{\alpha/2,\, n-2} \cdot s_e \sqrt{1 + \frac{1}{n} + \frac{(x^* - \bar{x})^2}{\sum (x_i - \bar{x})^2}} $$

\( s_e \)
Standard error of the regression (residual standard error)
\( t_{\alpha/2,\,n-2} \)
Critical value from the \( t \)-distribution with \( n-2 \) df
\( 1 + \frac{1}{n} + \cdots \)
The "1" accounts for individual variability: this is what makes PIs wider than CIs

Anatomy of the Standard Error

\( \text{SE}_{\text{pred}} = s_e \sqrt{1 + \tfrac{1}{n} + \tfrac{(x^* - \bar{x})^2}{SS_x}} \)
The "1" Individual noise (irreducible variance) \( \tfrac{1}{n} \) Uncertainty in the intercept (mean)
\( \tfrac{(x^* - \bar{x})^2}{SS_x} \)
Leverage of \(x^*\)
Prediction Interval = wider than Confidence Interval Because the "1" term is always present for individual predictions

Confidence vs Prediction Interval

Confidence Interval Prediction Interval
Target Mean response \( \mu_{Y|x^*} \) Individual observation \( Y \)
Includes Estimation uncertainty only Estimation + individual variability
Width Narrower Always wider
Extra term No "1" under radical "1" under radical
Shrinks to zero? Yes, as \( n \to \infty \) No: bounded below by \( \sigma \)

What Makes PIs Wider or Narrower?

1
Higher confidence level: Increasing from 90% to 99% uses a larger \( t^* \), widening the interval.
2
Larger \( s_e \): More scatter in the residuals means greater overall uncertainty.
3
Smaller \( n \): Fewer observations produce less precise coefficient estimates.
4
Farther \( x^* \) from \( \bar{x} \): The leverage term \( \frac{(x^* - \bar{x})^2}{SS_x} \) grows, widening the interval.
5
Smaller spread in \( x \) values (\( SS_x \)): Less variation in the predictor means a less stable slope estimate.

How to Compute a Prediction Interval

1
Fit the regression: Obtain \( b_0, b_1, s_e, \bar{x}, \) and \( SS_x = \sum(x_i - \bar{x})^2 \) from the data.
2
Compute the point forecast: Plug \( x^* \) into \( \hat{y} = b_0 + b_1 x^* \).
3
Find the critical value: Look up \( t_{\alpha/2, \, n-2} \) for your chosen confidence level.
4
Compute the SE: Evaluate \( s_e \sqrt{1 + \frac{1}{n} + \frac{(x^* - \bar{x})^2}{SS_x}} \).
5
Form the interval: \( \hat{y} \pm t^* \cdot \text{SE} \). Report and interpret in context.

Example 1: Study Hours and Exam Scores

A professor collects data from \( n = 25 \) students. The regression gives: \( \hat{y} = 40 + 5.2x \), \( s_e = 8.3 \), \( \bar{x} = 6.0 \), \( SS_x = 120 \). Predict the exam score for a student who studies \( x^* = 8 \) hours with a 95% PI.

1
Point forecast: \( \hat{y} = 40 + 5.2(8) = 81.6 \)
2
Critical value: \( t_{0.025, 23} \approx 2.069 \)
3
SE: \( 8.3\sqrt{1 + \tfrac{1}{25} + \tfrac{(8-6)^2}{120}} = 8.3\sqrt{1 + 0.04 + 0.0333} = 8.3\sqrt{1.0733} \approx 8.3(1.036) \approx 8.60 \)
4
Interval: \( 81.6 \pm 2.069(8.60) = 81.6 \pm 17.8 \) giving (63.8, 99.4)

Example 1: Visualized

Study Hours (x) Score (y) 0 2 4 6 8 40 60 80 100 99.4 63.8 81.6 \(x^*\!=\!8\) \(\bar{x}\)

Example 2: Extrapolation Warning

Using the same regression (\( \hat{y} = 40 + 5.2x \), \( n=25 \), \( s_e=8.3 \), \( \bar{x}=6 \), \( SS_x=120 \)), now predict for a student studying \( x^* = 14 \) hours: well beyond the observed range.

1
Point forecast: \( \hat{y} = 40 + 5.2(14) = 112.8 \) (already suspicious: exceeding 100 on a 100-point exam)
2
SE: \( 8.3\sqrt{1 + 0.04 + \frac{64}{120}} = 8.3\sqrt{1.573} \approx 8.3(1.254) \approx 10.41 \)
3
Interval: \( 112.8 \pm 2.069(10.41) = 112.8 \pm 21.5 \) giving (91.3, 134.3)

Example 3: How Distance Affects Width

Using the same model, compare the 95% PI width at three different values of \( x^* \):

\( x^* \) \( (x^*-\bar{x})^2/SS_x \) \(\text{SE}_{\text{pred}}\) PI Width
\( 6 \) (at \( \bar{x} \)) 0 8.47 35.0
\( 8 \) (+2 from \( \bar{x} \)) 0.033 8.60 35.6
\( 14 \) (+8 from \( \bar{x} \)) 0.533 10.41 43.1

Common Mistakes

✕ Confusing CI and PI
Using the CI formula when you need a PI: forgetting the "1" under the radical, producing an interval that is far too narrow for individual predictions.
✕ Blind Extrapolation
Applying the model far outside the observed \( x \) range and trusting the result. The PI honestly widens, but the model itself may be wrong outside the data.
✕ Ignoring Assumptions
PIs assume normally distributed errors with constant variance. If residuals are skewed or heteroscedastic, the stated coverage level won't hold.

Summary of Key Concepts

Concept Key Idea
Point Forecast \( \hat{y} = b_0 + b_1 x^* \): single best guess
Confidence Interval Interval for the mean \( \mu_{Y|x^*} \): estimation uncertainty only
Prediction Interval Interval for an individual \( Y \): estimation + individual variability
Width Drivers \( s_e \), \( n \), confidence level, \( |x^* - \bar{x}| \), \( SS_x \)
Limiting Behavior \( \text{CI} \to 0 \) as \( n \to \infty \); \( \text{PI} \to \) an interval with width \( \approx 2 z^* \sigma \)
Extrapolation Technically computable, but model validity is not guaranteed beyond data range

Question 1 of 5

A 95% prediction interval for an individual \( Y \) at \( x^* \) is always ______ than a 95% confidence interval for \( \mu_{Y|x^*} \) at the same \( x^* \).

Question 2 of 5

As the sample size \( n \to \infty \), the width of a 95% prediction interval:

Question 3 of 5

Which value of \( x^* \) will produce the narrowest prediction interval?

Question 4 of 5

A regression model has \( s_e = 12 \), \( n = 50 \), \( \bar{x} = 10 \), \( SS_x = 500 \). At \( x^* = 10 \), what is \( \text{SE}_{\text{pred}} \)?

Question 5 of 5

A 90% prediction interval for a student studying 5 hours is (62, 88). Which interpretation is correct?