Grade by Grade
D. Data · Data, Statistics and Mathematical Modelling

Testing Regression Models: Linear, Quadratic and Exponential

D1.3 A1About 75 minutes
Learning goals
  • I can use technology to fit linear, quadratic and exponential regression models to data.
  • I can use R² (or r²), the graph and the context to decide which model fits best.
  • I can use a chosen model to make predictions and explain when they are appropriate.

Words to know

regression model
An equation found by technology that fits a set of data as closely as possible.
quadratic model
A model of the form y = ax² + bx + c; its graph is a parabola.
exponential model
A model of the form y = a·bˣ; it grows or decays by a constant factor b.
parabola
The U-shaped (or upside-down U) graph of a quadratic relation.
coefficient of determination (R²)
A number from 0 to 1 that measures how well a model fits the data; closer to 1 is a better fit.
exponential growth / decay
Increase (b > 1) or decrease (0 < b < 1) by the same factor each step.

Not every pattern is a straight line

A baseball player hits a high pop fly. A phone records the ball's height every 0.3 seconds. When you plot the data, it goes up and then down. A straight line cannot model that! The correlation coefficient for a linear model is close to 0, even though there is clearly a strong pattern.

The curriculum asks you to test different regression models using technology and decide which one fits best. In this lesson you will test linear, quadratic and exponential models.

ModelEquationShapeTypical situations
Lineary = mx + bStraight line; constant rate of changeSteady costs, steady drain or growth (adds the same amount each step)
Quadraticy = ax² + bx + cParabola (U shape or upside-down U)Height of a thrown object, area as length changes, profit that rises then falls
Exponentialy = a·bˣCurve that grows (b > 1) or decays (0 < b < 1) by a constant factorPopulation growth, compound interest, spreading videos, cooling, medicine in the body
Three regression models. You will meet linear and non-linear relations in more detail in the relations unit of this course and in Grade 10.

How to test models with technology

In Desmos, put the data in a table (x₁, y₁). Then type each model on its own line:

y_1 ~ m x_1 + b (linear: Desmos shows m, b, r and r²)
y_1 ~ a x_1^2 + b x_1 + c (quadratic: shows a, b, c and R²)
y_1 ~ a b^(x_1) (exponential: shows a, b and R²)

Desmos regression entries. The ~ symbol means "fit this model to the data".

Three ways to judge a model

  1. The coefficient of determination, R² (or r²). It is a number from 0 to 1 that tells how much of the variation in y the model explains. Closer to 1 means a closer fit. For a linear model, R² = r² (the square of the correlation coefficient).
  2. The graph. Does the curve go through the middle of the points all the way along? Are the residuals (vertical gaps) random, or is there a pattern, such as all points above the line at both ends?
  3. The context. Does the shape make sense for the situation? Would its predictions be reasonable just beyond the data?

A model can have a high R² and still be a poor choice if it makes no sense in context.

Time (s)Height (m)
01.5
0.34.7
0.66.9
0.98.4
1.28.8
1.58.5
1.87.2
2.15.1
2.42.1
Data for Example 1.
Worked example

Example 1: The pop fly

(The data is in the table above.)

Test a linear and a quadratic model. Which is better? Use it to estimate the maximum height and when the ball hits the ground.

  1. Linear: Desmos gives y ≈ 0.24x + 5.62 with r ≈ 0.07, so r² ≈ 0.005. The model explains almost none of the variation. The graph shows points far above the line in the middle and far below it at the ends.
  2. Quadratic: Desmos gives y ≈ −4.89x² + 11.98x + 1.52 with R² ≈ 0.9998. The parabola passes almost exactly through every point.
  3. Context: a ball goes up, slows, and comes down: a parabola makes sense. (Physics tells us the a-value for a falling object on Earth should be close to −4.9 when height is in metres and time in seconds, and our model gives −4.89.)
  4. Maximum height: trace the parabola in Desmos. The vertex is at about (1.22, 8.85), so the ball reaches about 8.8 m after about 1.2 s.
  5. Ground: the parabola crosses y = 0 at about x ≈ 2.57 s (a small extrapolation just past the last data point).

The quadratic model is far better (R² ≈ 0.9998 vs 0.005), it matches the context, and it predicts a maximum height of about 8.8 m and landing after about 2.6 s.

Pop fly: height of a baseball00.40.81.21.622.42.80246810time (s)height (m)linearquadratic
The dashed linear model is almost flat and misses the pattern. The solid quadratic model (a parabola opening down) follows the rise and fall of the ball.
DayViews
0120
1190
2310
3490
4790
51 260
62 010
73 230
Data for Example 2.
Worked example

Example 2: A video that keeps spreading

A student posted a video about the school's winter carnival. Total views:

(The data is in the table above.)

Test three models and choose the best. Predict the views on day 10 with each.

  1. Linear: y ≈ 405x − 367.5, r² ≈ 0.835. The line predicts −367.5 views on day 0 (impossible), and the points curve away from it.
  2. Quadratic: y ≈ 86.55x² − 200.83x + 238.33, R² ≈ 0.987. Better, but the parabola dips between day 0 and day 2, which would mean total views going down: impossible, since total views can only grow.
  3. Exponential: y ≈ 119.67(1.601)ˣ, R² ≈ 0.99999 (rounds to 1.000). The curve passes through every point.
  4. Context check: each day the total is about 1.6 times the day before (190 ÷ 120 ≈ 1.58; 3 230 ÷ 2 010 ≈ 1.61). Growth by a constant factor is exactly what an exponential model describes.
  5. Day 10 predictions: linear 405(10) − 367.5 ≈ 3 683; quadratic 86.55(100) − 200.83(10) + 238.33 ≈ 6 885; exponential 119.67(1.601)¹⁰ ≈ 13 240.

The exponential model fits best by R², by the graph and by the context. Its day-10 prediction is about 13 000 views. But it is an extrapolation: a school video cannot keep growing by 60% a day forever, because eventually everyone interested has seen it.

Views of a school video01234567801000200030004000daytotal viewslinearexponentialquadratic
Three models for the same data. The solid exponential curve passes through every point. The dotted quadratic curve dips down at the start, and the dashed line misses both ends.

Watch out

  • A higher R² is good evidence, but always check the graph and the context too.
  • A model that fits the data perfectly can still give silly predictions if you extrapolate too far.
  • With very few points, almost any model can look good. More data gives you more confidence.
Just for fun

Riddle: I start out small, but every day I multiply by the same number. Bankers love me, epidemiologists worry about me, and your video would like me as a friend. What am I?

Exponential growth!

Hands-on activity

Bouncing ball heights

You need: a bouncy ball, a measuring tape taped vertically to a wall or door frame (ask a grown-up first), and a phone that can record slow-motion video (optional but helpful).

  1. Drop the ball from 150 cm. Record the height of the first, second, third, fourth and fifth bounce (a slow-motion video makes this easier). Do it 3 times and use the mean height for each bounce.
  2. Make a table: bounce number (0 for the drop height of 150 cm, then 1 to 5) and height (cm).
  3. Enter the data in Desmos. Test linear, quadratic and exponential models. Record R² for each.
  4. Which model fits best? Does it make sense that each bounce is about the same fraction of the one before?
  5. Use your best model to predict the height of the 8th bounce.

What to look for: the exponential model with 0 < b < 1 (decay) usually fits best, because each bounce reaches roughly the same fraction of the previous height. The linear model will eventually predict negative heights.

Your turn

1

Which model type would you test first for each? (a) The cost of a taxi: $4 plus $2 per km. (b) The height of a basketball shot over time. (c) The amount of a medicine in the body, which falls by 20% each hour.

2

Three models for the same data give R² = 0.82 (linear), 0.97 (quadratic) and 0.91 (exponential). Which fits best by R²?

3

A linear regression gives r = −0.9. What is r²?

4

Use y = 50(1.2)ˣ to predict y when x = 3.

5

Use y = −4.9x² + 20x + 2 to find the height when x = 2.

6

A quadratic model of a town's population over 10 years has R² = 0.99, but it predicts the population will begin to fall next year even though the town is growing quickly. Should you use it to predict? Explain.

7

What does the symbol ~ mean in a Desmos regression?

More practice: warm-up

1

What shape is the graph of a quadratic model?

2

In y = a·bˣ, does b = 0.7 show growth or decay?

3

What is the largest possible value of R²?

4

In a linear model, what is constant: the rate of change or the factor of change?

5

Which model has a constant factor of change?

More practice: on your own

1

The table shows x: 0, 1, 2, 3 and y: 5, 10, 20, 40. Which model fits exactly? Write its equation.

2

The table shows x: 0, 1, 2, 3 and y: 5, 8, 11, 14. Which model fits exactly? Write its equation.

3

The table shows x: 0, 1, 2, 3, 4 and y: 0, 3, 4, 3, 0. Which model would fit? Explain.

4

A cup of hot chocolate cools. Its temperature above room temperature is 60 °C, then 45, 34, 25, 19 every 5 minutes. Which model would you test first? Why?

5

For the pop-fly model y = −4.89x² + 11.98x + 1.52, find the height at x = 1. Compare it to the data.

Challenge

1

A model y = 120(1.6)ˣ gives total views after x days. Use technology or guess and check to find the first day on which it predicts more than 50 000 views. Why might the real views be lower?

2

Explain why R² alone cannot tell you whether a model is appropriate. Use the video example.

3

Using the pop-fly quadratic model, find the two times when the ball is at 5 m, using technology or guess and check to one decimal place.

Check your understanding

Quiz

1.

Which model is best for a situation that grows by the same factor each step?

2.

Which R² shows the closest fit?

3.

Data on the height of a thrown ball over time is best modelled by...

4.

A linear model has r = 0.6. What is r²?

5.

Using y = 200(0.5)ˣ, what is y when x = 3?

6.

A model fits the data with R² = 0.99 but predicts a negative number of people next year. What should you conclude?

For parents and teachers

Big idea: D1.3 asks students to determine the correlation "by testing different regression models using technology". Students are not expected to calculate these regressions by hand; they are expected to run them, compare them, and choose wisely.

How to help: Open Desmos with your teen and enter the video data from Example 2. Type the three regression lines and look together at which curve passes through the points. Ask "Does that make sense in real life?"

Common difficulties:

  • Choosing a model only by R² without looking at the graph or the context.
  • Typing the Desmos entries without the ~ or with the wrong subscripts.
  • Forgetting the order of operations with exponents: in 50(1.2)³, cube 1.2 first, then multiply by 50.

Safety: in the bouncing-ball activity, use a clear floor area away from breakables.