Fitting Models
to Data
Learn to select the best regression model for a dataset, use technology to find the equation, and interpret parameters in real-world context.
What Does It Mean to Fit a Model?
Fitting a model means finding a mathematical equation that best describes the relationship between variables in a dataset. We use technology: graphing calculators, Desmos, or spreadsheets: to compute the equation that minimizes the overall error.
Types of Regression Models
Constant rate of change
One turn (max or min)
Multiplicative growth/decay
Visualizing Different Fits
Each model type produces a different curve shape. The scatter plot's pattern tells you which to choose.
The Correlation Coefficient \( r \) and \( r^2 \)
After fitting a model, technology reports \( r \) (for linear) or \( r^2 \) (for all types). These tell you how well the model matches the data.
Understanding Residuals
A residual is the difference between an observed value and the value predicted by the model:
A good fit has residuals that are small and randomly scattered (no pattern). If residuals show a curve, try a different model type.
Interpolation vs Extrapolation
How to Fit a Model: Step by Step
Interpreting Parameters in Context
The numbers in your regression equation have real-world meaning. You must connect them back to the problem scenario.
\( b \) = starting value when \( x = 0 \)
\( c \) = initial value when \( x = 0 \)
\( b \) = growth/decay factor per unit of \( x \)
Example 1: Linear Regression
A store tracks monthly sales (\( y \), in thousands) over months since opening (\( x \)). Technology gives:
Example 2: Quadratic Regression
A ball is launched upward. Height (\( y \), in feet) is recorded at various times (\( x \), in seconds). Technology gives:
Example 3: Exponential Regression
A population of bacteria (\( y \), in thousands) is measured every hour (\( x \)). Technology gives:
Constraints and Domain Limits
A regression model is only valid under certain constraints. Always consider the real-world context when interpreting or using your model.
When to Switch Models
If your first regression choice has a low \( r^2 \) or a patterned residual plot, try a different model type.
Common Mistakes
Model Comparison Summary
| Feature | Linear | Quadratic | Exponential |
|---|---|---|---|
| Equation | \( y = ax + b \) | \( y = ax^2 + bx + c \) | \( y = a \cdot b^x \) |
| Shape | Straight line | Parabola (U or ∩) | Curve (growth/decay) |
| Rate of Change | Constant | Changes linearly | Multiplicative |
| Key Parameter | \( a \) = slope | \( a \) = curvature direction | \( b \) = growth factor |
| Best For | Steady trends | Projectiles, arcs | Populations, finance |
Question 1 of 5
A regression model gives \( y = 3.2x + 18 \) for the relationship between weeks (\( x \)) and total items sold (\( y \)). What does the 3.2 represent?
Question 2 of 5
A researcher fits an exponential model \( y = 50 \cdot 0.85^x \) to data about a medicine's concentration (\( y \) mg) over hours (\( x \)). What does \( b = 0.85 \) tell us?
Question 3 of 5
You run a linear regression on a dataset and get \( r^2 = 0.42 \). The residual plot shows a clear U-shaped pattern. What should you do?
Question 4 of 5
A quadratic model \( y = -4.9x^2 + 20x + 1.5 \) describes the height (meters) of a kicked ball over time (seconds). Data was collected for \( 0 \leq x \leq 4 \). Which prediction is most reliable?
Question 5 of 5
Two models are fit to the same dataset. Model A (linear) has \( r^2 = 0.89 \). Model B (exponential) has \( r^2 = 0.97 \). Both have randomly scattered residuals. Which model should you choose and why?