01 / 21

Regression
Modeling

Learn to fit linear, quadratic, and exponential models to real-world data using technology and the coefficient of determination \( r^2 \).

IB Math: Applications & Interpretation

What Is Regression?

Regression is a statistical method for finding the best-fitting mathematical model that describes the relationship between an independent variable \( x \) and a dependent variable \( y \). Instead of connecting every point, we find a smooth curve that captures the overall trend in the data.

Three Model Types in SL 2.7

Linear
\( y = ax + b \)
Constant rate of change: straight line
Quadratic
\( y = ax^2 + bx + c \)
Increasing then decreasing (or vice versa): parabola
Exponential
\( y = a \cdot b^x \)
Rapid growth or decay: curved growth

Seeing the Fit

x y Linear Quadratic Exponential

The Coefficient of Determination: \( r^2 \)

\( r^2 \) measures how well a regression model fits the data. It gives the proportion of the variation in \( y \) that is explained by the model.

\( r^2 = 1 \)
Perfect fit: every data point lies exactly on the curve
\( r^2 = 0 \)
No fit: the model explains none of the variation in \( y \)

Interpreting \( r^2 \) Visually

r² = 0.98 r² = 0.65 r² = 0.12

When \( r^2 \) is high, points cluster tightly around the model. When \( r^2 \) is low, points are scattered with no clear pattern: the model is a poor predictor.

Formal Model Equations

1
Linear regression: \( y = ax + b \) where \( a \) is the slope and \( b \) is the \( y \)-intercept. The correlation coefficient is \( r \), so \( r^2 \) measures fit.
2
Quadratic regression: \( y = ax^2 + bx + c \). The vertex is at \( x = -\frac{b}{2a} \). Use \( r^2 \) (or \( R^2 \)) to assess quality of fit.
3
Exponential regression: \( y = a \cdot b^x \) (some GDCs use \( y = a \cdot e^{bx} \)). Growth when \( b > 1 \), decay when \( 0 < b < 1 \).

Correlation vs Regression

Correlation Regression
Purpose Measures strength of linear association Finds a model equation to predict \( y \)
Output \( r \) (a number from \(-1\) to \(1\)) \( y = f(x) \) (an equation)
Direction Symmetric: \( r(x,y) = r(y,x) \) Asymmetric: \( y \) on \( x \) differs from \( x \) on \( y \)
Model type Linear only (\( r \)) Linear, quadratic, exponential, and more

How to Perform Regression

1
Plot the data: Enter the \( (x, y) \) values and create a scatter plot. Observe the shape: linear, curved, or exponential?
2
Choose a model type: Based on the scatter plot shape, select linear, quadratic, or exponential regression on your GDC.
3
Run the regression: The calculator outputs the equation parameters and \( r^2 \).
4
Evaluate the fit: Compare \( r^2 \) values. The model with \( r^2 \) closest to 1 is the best fit.
5
Use the model: Substitute an \( x \)-value into the equation to predict \( y \). State your answer in context.

Example 1: Linear Regression

A student measures temperature (\( x \) in °C) and ice cream sales (\( y \) in hundreds). The GDC gives:
\( y = 3.2x + 12.5 \), \( r^2 = 0.94 \).

Temperature (°C) Sales 10 20 30 40 y = 3.2x + 12.5

Example 2: Quadratic Regression

A ball is thrown upward. Height \( y \) (m) is recorded at times \( x \) (s):
\( (0, 1), (0.5, 4.8), (1, 7.1), (1.5, 7.9), (2, 7.2), (2.5, 4.9), (3, 1.2) \). A quadratic model is fitted: \( y = -4x^2 + 12x + 1 \).

Time (s) Height (m) 0 1 2 3
\( y = -4x^2 + 12x + 1 \)
\( r^2 \approx 0.998 \)

Example 3: Exponential Regression

Bacteria population \( y \) (thousands) is measured every hour \( x \):
\( (0, 2), (1, 3.1), (2, 4.7), (3, 7.2), (4, 11), (5, 16.8) \).

Hours Pop. (1000s)
\( y = 2.02(1.53)^x \)
\( r^2 = 0.999 \)
Linear: \( r^2 = 0.92 \)

Interpolation vs Extrapolation

Interpolation
Predicting within the range of your data. Generally reliable if \( r^2 \) is high.
Extrapolation
Predicting beyond the range of your data. Risky: the trend may not continue.

Choosing the Right Model

1
Look at the scatter plot shape: Straight line → linear. U-shape / arch → quadratic. J-curve → exponential.
2
Context clues: Constant growth rate → linear. Projectile or area → quadratic. Population or decay → exponential.
3
Compare \( r^2 \) values: Run all three regressions and pick the model with the highest \( r^2 \).
4
Check reasonableness: Does the model make sense in context? An exponential model predicting infinite sales is probably wrong.

Common Mistakes

✕ Confusing \( r \) and \( r^2 \)
\( r = 0.9 \) means \( r^2 = 0.81 \), not \( 0.9 \). Always square it to interpret the percentage of variation explained.
✕ Forcing a linear model
If the data curves, a straight line will have a lower \( r^2 \). Always check quadratic and exponential alternatives.
✕ Extrapolating blindly
A model valid from \( x = 0 \) to \( x = 10 \) may give nonsense at \( x = 100 \). State the limitation in your answer.

Summary Comparison

Linear Quadratic Exponential
Equation \( y = ax + b \) \( y = ax^2 + bx + c \) \( y = a \cdot b^x \)
Shape Straight line Parabola J-curve
When to use Constant rate of change Turning point (max/min) Growth or decay
Parameters 2: \( a, b \) 3: \( a, b, c \) 2: \( a, b \)
Key feature Slope \( a \) Vertex Base \( b \)

Question 1 of 5

A regression model has \( r^2 = 0.85 \). What does this mean?

Question 2 of 5

A scatter plot shows data that increases, reaches a peak, then decreases. Which regression model is most appropriate?

Question 3 of 5

An exponential regression gives \( y = 5.0 \times 1.12^x \). If \( x \) represents years, what does the base 1.12 tell us?

Question 4 of 5

Data is collected for \( x \) values from 1 to 10. A student uses the regression equation to predict \( y \) when \( x = 50 \). This is an example of:

Question 5 of 5

Three models are fitted to the same data set. Their \( r^2 \) values are: Linear \( 0.78 \), Quadratic \( 0.96 \), Exponential \( 0.91 \). Which model should be chosen?