01 / 20

Prediction &
Forecasting

Learn how regression models make predictions, why extrapolation is risky, and how to interpret forecasts with confidence intervals.

Business Statistics

What Is Prediction?

In statistics, prediction means using a mathematical model to estimate the value of a response variable \( \hat{y} \) for a given value of the explanatory variable \( x \). If we have a regression line \( \hat{y} = b_0 + b_1 x \), we simply plug in our chosen \( x \) to get the predicted value.

The Regression Line as a Tool

Advertising Spend (hundreds) Revenue ($) 0 5 10 15 20 Predicted value
\( x = 15 \rightarrow \hat{y} = \$17,250 \)
\( \hat{y} = b_0 + b_1 x \)

Interpolation vs Extrapolation

The critical distinction in forecasting is where your \( x \)-value falls relative to the data you used to build the model.

Interpolation
Predicting within the range of observed \( x \)-values. The model has direct support from nearby data points, so predictions tend to be reliable.
Extrapolation
Predicting beyond the observed range of \( x \). The model assumes the same trend continues, but real-world relationships often change, making predictions unreliable.

The Danger Zone of Extrapolation

\( x \)
\( y \)
Observed Range (Interpolation) Extrapolation Zone Reality Model predicts

The Prediction Equation

For simple linear regression, the predicted value at a given \( x^* \) is:

\( b_0 \)
The y-intercept: predicted value when \( x = 0 \)
\( b_1 \)
The slope: change in \( \hat{y} \) per one-unit increase in \( x \)
\( x^* \)
The specific input value for which we want a prediction

Confidence vs Prediction Intervals

Two types of intervals quantify uncertainty when we forecast. They look similar but answer different questions.

Confidence Interval
Estimates the mean response \( \mu_{y|x^*} \) for all individuals at \( x^* \). Narrower, because averaging reduces variability.
Prediction Interval
Estimates a single new observation \( y \) at \( x^* \). Wider, because it accounts for individual scatter around the mean.

Intervals Widen Away from \( \bar{x} \)

\( x \)
\( \bar{x} \)
Prediction Confidence Narrowest
at \(\bar{x}\)

Forecasting vs Prediction

Prediction Forecasting
Goal Estimate \( y \) for a known \( x^* \) Estimate future values over time
Data axis Any explanatory variable Time is the explanatory variable
Context Cross-sectional or experimental Time series data
Key risk Extrapolation beyond \( x \)-range Structural changes over time
Example Predict sales from ad spend Forecast next quarter's sales

Why Extrapolation Fails

1
Linearity breaks down. Relationships that appear linear over a small range are often curved over a larger range.
2
No supporting data. Beyond the observed range, you have zero data points to anchor the model. You are making an assumption, not a measurement.
3
Prediction intervals explode. The margin of error grows rapidly with distance from \( \bar{x} \), making extrapolated predictions practically useless.
4
Lurking variables change. Outside the observed range, new factors may emerge that the model never accounted for.

How to Make a Responsible Prediction

1
Check the range. Is your \( x^* \) within the observed data? If not, flag it as extrapolation.
2
Verify model fit. Check \( R^2 \), residual plots, and that linearity assumptions hold.
3
Compute \( \hat{y} \). Substitute \( x^* \) into the regression equation \( \hat{y} = b_0 + b_1 x^* \).
4
Build the interval. Use a prediction interval for individual values, or a confidence interval for the mean response.
5
Communicate uncertainty. Always report the interval alongside the point estimate. Never present \( \hat{y} \) alone.

Example 1: Basic Prediction

A café finds that daily iced coffee sales (\( y \)) relate to temperature (\( x \), in °F) by the regression equation:

Question: Predict iced coffee sales when the temperature is \( 80°F \).

Example 2: Extrapolation Warning

Using the same model: \( \hat{y} = -50 + 3.2x \), data range [55, 95].

Question: Predict sales when temperature is \( 110°F \).

Example 3: Prediction Interval

A retailer models weekly online orders (\( y \)) from website visits (\( x \), in thousands). At \( x^* = 12 \), software reports:

Point Estimate
\( \hat{y} = 847 \) orders
95% CI for Mean
(820, 874) orders
95% PI for Individual
(710, 984) orders

Common Mistakes

✕ Blind Extrapolation
Using the regression equation far outside the data range without acknowledging increased uncertainty.
✕ Confusing Intervals
Using a confidence interval when a prediction interval is needed (individual vs. mean response).
✕ Ignoring Residuals
Predicting from a model with poor fit: non-linear patterns, outliers, or non-constant variance in the residuals.

Summary of Key Concepts

Concept Definition Reliability
Interpolation Predicting within the data range High
Extrapolation Predicting beyond the data range Low / Risky
Confidence Interval Interval for the mean at \( x^* \) Narrower
Prediction Interval Interval for a single observation Wider
Forecasting Predicting future values over time Depends on horizon

Question 1 of 5

A regression model is built using data where \( x \) ranges from 10 to 50. A manager uses the model to predict \( y \) when \( x = 75 \). This is an example of:

Question 2 of 5

Which interval is always wider: the 95% confidence interval for the mean response, or the 95% prediction interval for an individual observation?

Question 3 of 5

Given \( \hat{y} = 200 + 15x \), what is \( \hat{y} \) when \( x = 8 \)?

Question 4 of 5

Both the confidence interval and prediction interval are narrowest at which point?

Question 5 of 5

A company's regression model predicts revenue from employee count. The data includes companies with 50 to 500 employees. The CEO of a 10-person startup asks for a revenue prediction. What should the analyst say?