Historical Context & Motivation
Humans have always tried to predict the future—when crops would ripen, how far a ship could sail in a day, or how fast a population might grow. For centuries, those predictions relied on intuition and experience. The development of linear models gave us a mathematical way to turn observed patterns into precise forecasts. The story of using straight lines to make predictions stretches back surprisingly far and remains one of the most widely used tools in modern data science.
Despite the power of fitting a line to data, a critical question always lurked in the background: How far beyond our data can we safely predict? This question leads to the distinction between interpolation and extrapolation—the heart of this lesson.
Core Principles & Definitions
Before you can use a linear model to make predictions, you need to understand a few key ideas. A linear model is an equation of the form y = mx + b that describes the trend in a set of data. When the data points roughly follow a straight-line pattern, a linear model captures that trend and lets you estimate y-values for x-values you haven't directly observed. However, the reliability of that estimate depends heavily on where your x-value falls relative to the original data.
Linear Model (Line of Best Fit)
Interpolation
Extrapolation
Domain of the Data
Visual Explanation — Interpolation vs. Extrapolation
The diagram below shows a scatter plot with a line of best fit drawn through the data. The shaded green region represents the interpolation zone—the range of x-values covered by the original data. The red-shaded regions on either side represent the extrapolation zones where predictions become increasingly uncertain.
In the diagram, the seven violet dots are the observed data. The solid cyan line passes through the middle of them, representing the linear model. Notice that the prediction inside the green zone (the circled cyan dot) sits among actual data points, so the line's estimate is well supported. The prediction in the red zone (the circled red dot) lies far beyond any observed value, so it's little more than a guess—the real-world pattern might curve, level off, or reverse.
Mathematical Framework
The mathematical backbone of making predictions with a linear model is the familiar slope-intercept equation. Once you have the equation of the line of best fit, you simply substitute the desired x-value to compute the predicted y-value. Understanding the components of that equation helps you interpret every prediction you make.
Detailed Breakdown — Interpolation vs. Extrapolation
The distinction between interpolation and extrapolation is not just academic—it affects the confidence you should place in every prediction. The diagram below illustrates a real-world scenario: a student tracks the number of hours they study per week and their average test score over several months. The linear model fits the data well within the observed range, but watch what happens when we try to predict far beyond it.
| Feature | Interpolation | Extrapolation |
|---|---|---|
| x-value location | Within the range of the original data | Outside the range of the original data |
| Reliability | Generally reliable | Less reliable, riskier |
| Example | Predicting score at 5 study hours when data spans 2–9 hours | Predicting score at 15 study hours when data spans 2–9 hours |
| Key risk | Data scatter may cause small errors | The real-world trend may curve, plateau, or reverse |
Worked Example
A local bakery tracks weekly advertising spending (in dollars) and weekly revenue (in dollars) over eight weeks. A linear model is calculated to be ŷ = 12x + 300, where x is the advertising spend and ŷ is the predicted revenue. The data spans advertising amounts from $50 to $200. Use the model to predict revenue when spending is $120 and when spending is $350, then determine which prediction involves interpolation and which involves extrapolation.
Strengths & Limitations of Linear Predictions
Linear models are powerful and easy to use, but they aren't perfect. Knowing when a linear model shines—and when it falls short—is a critical skill in statistics. The table below outlines the main strengths and limitations you should keep in mind every time you use a linear model to make a prediction.
| Strengths | Limitations |
|---|---|
| Easy to calculate and understand — just plug in x. | Assumes the relationship is perfectly linear, which real data often isn't. |
| Interpolated predictions are usually close to actual values. | Extrapolated predictions can be wildly inaccurate, especially far from the data. |
| Identifies the direction and rate of a trend quickly. | Cannot capture curves, plateaus, or turning points in the data. |
| Works well as a first approximation for many real-world relationships. | The y-intercept may have no meaningful real-world interpretation. |
Connection to Advanced Models
Linear models are the starting point, but statistics offers more sophisticated tools for situations where a straight line doesn't fit. As you advance in math, you'll encounter models that can handle curves, multiple variables, and complex real-world phenomena. The table below gives a brief preview of how the ideas from this lesson extend into more advanced territory.
| Concept in This Lesson | Advanced Extension |
|---|---|
| Line of best fit (y = mx + b) | Multiple regression — uses two or more independent variables (e.g., ŷ = a + b₁x₁ + b₂x₂) |
| Linear trend only | Polynomial & exponential regression — fits curves, not just straight lines, to data that bends or accelerates |
| Interpolation vs. extrapolation (judgment call) | Confidence & prediction intervals — statistical ranges that quantify how uncertain each prediction is |
| Visual inspection of scatter plot | Residual analysis — plotting prediction errors to check whether a linear model is appropriate |
Even with all these advanced tools, the core idea you've learned today remains central: predictions inside your data range are more trustworthy than predictions outside it. That principle applies whether you're fitting a straight line in Grade 9 or building a neural network in college. Mastering the basics now gives you a strong foundation for everything ahead.
Practice Problems
Lesson Summary
A linear model of the form ŷ = mx + b captures the trend in a scatter plot and allows you to predict the value of the dependent variable for any given x. When the x-value falls within the range of the original data, the prediction is called interpolation and is generally reliable. When the x-value falls outside the range of the original data, the prediction is called extrapolation and carries greater risk because the real-world pattern may change beyond the observed values.
Key limitations to remember: linear models assume a constant rate of change, cannot capture curves or plateaus, and the y-intercept may not have a meaningful real-world interpretation. Always identify whether a prediction uses interpolation or extrapolation, and consider whether the result is reasonable in context. These skills form the foundation for more advanced statistical modeling.