8.4 Fitting Models to Data
OCR A-level Maths Year 1 (AS) · H240 · Chapter 8: Exponential Models
What is in the full lesson (13 activities)
Every item below opens free in the course.
- Video: Logarithms and Non-Linear Data: Introduction
- Video: Logarithms and Non-Linear Data: example 1
- Video: Logarithms and Non-Linear Data: example 2
- Video: Logarithms and Non-Linear Data: example 3
- Video: Logarithms and Non-Linear Data: example 4
- Video: Logarithms and Non-Linear Data: example 5
- Video: Logarithms and Non-Linear Data: example 6
- Notes: Lesson notes: Fitting Models to Data
- Interactive lesson: Interactive lesson: Log Graph Straightener
- Interactive lesson: Interactive practice: Fitting Models to Data Practice
- Practice questions: Practice questions (8 questions, 12 marks)
- Worksheet: Worksheet: Fitting Models to Data
- Answers: Answers and mark scheme of the Worksheet: Fitting Models to Data
A free OCR A-level Maths Year 1 lesson for OCR A Level Mathematics A (H240) from OBA School: using logarithmic graphs to estimate the constants in y = ax to the n and y = kb to the x (OCR H240: 1.06h). Watch the video, read the explanation and worked examples, then try the revision questions. You can work through the full lesson, with more videos, an interactive lesson, a practice quiz and printable worksheets, in our free online course.
What you will learn
- Take logs of y = kbˣ to get a straight line of log y against x, and interpret its gradient and intercept
- Take logs of y = axⁿ to get a straight line of log y against log x
- Find the constants of a model from the equation of a line or from data, and use the model to predict
- Decide which type of model fits a set of data, and comment on how reliable a prediction is
Key words
- Exponential model: A model y = kbˣ: y is multiplied by b each time x increases by 1.
- Power model: A model y = axⁿ, where n is a constant power.
- Log-linear graph: A graph of log y against x. A straight line means an exponential model fits.
- Log-log graph: A graph of log y against log x. A straight line means a power model fits.
- Extrapolation: Using a model outside the range of the data. Such predictions are less reliable.
Exponential models: log y against x
Curves are hard to fit by eye, but straight lines are easy. Taking logs of both sides of y = kbˣ and using the laws of logarithms turns it into the equation of a straight line.
Key fact: y = kbˣ gives log y = log k + x log b. Plot log y against x: a straight line with gradient log b and intercept log k.
Any base can be used; base 10 and base e are the usual choices. With base 10, undo the log with 10 to the power …; with ln, undo it with e to the power ….
Worked example: from the equation of the line
For y = kbˣ, the graph of log₁₀ y against x is a straight line with gradient 0.3 and intercept 0.7. Find k and b.
log k = 0.7, so k = 10 to the power 0.7 = 5.011... log b = 0.3, so b = 10 to the power 0.3 = 1.995...
Answer: k = 5.01, b = 2.00 (3 s.f.), so y ≈ 5 × 2ˣ
Power models: log y against log x
Key fact: y = axⁿ gives log y = log a + n log x. Plot log y against log x: a straight line with gradient n and intercept log a.
Worked example: from two points on the line
For y = axⁿ, the graph of ln y against ln x is a straight line through (0.5, 1.9) and (1.5, 4.3). Find a and n.
Gradient n = (4.3 − 1.9)/(1.5 − 0.5) = 2.4. Intercept: ln a = 1.9 − 2.4 × 0.5 = 0.7.
a = exp(0.7) = 2.013...
Answer: n = 2.4, a = 2.01 (3 s.f.), so y = 2.01x to the power 2.4
Note the difference: for a power model both variables are logged and the gradient is the power itself; for an exponential model only y is logged and the gradient is log b.
Fitting a model to data
The number N of yeast cells (in thousands) in a culture is recorded every hour. A scientist thinks that N = kbᵗ.
- N; 1 30; 2 45; 3 68; 4 101; 5 152
- log N; 1 1.477; 2 1.653; 3 1.833; 4 2.004; 5 2.182
Worked example: finding the constants
Using the line through the first and last points: gradient = (2.182 − 1.477)/(5 − 1) = 0.1762..., so b = 10 to the power 0.1762 = 1.500...
Intercept: log k = 1.477 − 0.1762 × 1 = 1.301..., so k = 10 to the power 1.301 = 20.0.
Prediction at t = 6: N = 20 × 1.5⁶ = 227.8..., about 228 thousand cells.
Answer: N = 20 × 1.5ᵗ
In an exam you may be given the line of best fit, or asked to draw it and read two well-separated points from it. A prediction just beyond the data (such as t = 6) is fairly reliable; one far beyond it (such as t = 30) is extrapolation and much less reliable, as growth cannot continue for ever.
Which model fits?
Plot both log y against x and log y against log x. Whichever is closer to a straight line tells you the type of model.
- log y against x; Model y = kbˣ; Gradient log b; Intercept log k
- log y against log x; Model y = axⁿ; Gradient n; Intercept log a
Worked example: a power model from data
x: 2, 4, 8, 16 y: 8.5, 24, 67.9, 192. log x: 0.301, 0.602, 0.903, 1.204 log y: 0.929, 1.380, 1.832, 2.283
The log-log points lie on a line. Gradient = (2.283 − 0.929)/(1.204 − 0.301) = 1.499...; intercept = 0.929 − 1.499 × 0.301 = 0.478.
a = 10 to the power 0.478 = 3.006...
Answer: y ≈ 3x to the power 1.5
Common mistakes
- Using log b or log k as the answer. Undo the log: if the gradient is m and the intercept is c, then b = 10ᵐ and k = 10ᶜ.
- Mixing bases: if the graph uses ln, then k = eᶜ, not 10ᶜ.
- Plotting log y against x for a power model. A power model needs log x on the horizontal axis.
- Reading the intercept from a graph whose horizontal axis does not start at 0.
- Trusting predictions far outside the data without comment.
Revision questions
Try these, then check your answers below each one.
Question 1. Which graph is a straight line when y = kbˣ? (Choose from: log y against x; log y against log x; y against log x; y against x.)
Answer: log y against x
Working: log y = log k + x log b is linear in x.
Question 2. Two variables are related by ln y = 1.5 + 0.2x. Writing this as y = k exp(0.2x), find k to 3 significant figures.
Answer: 4.48
Working: y = e¹.5)e⁰.2x), so k = e¹.5) = 4.481...
Question 3. For y = 3x⁴, what is the gradient of the graph of ln y against ln x? (Choose from: 4; ln 4; 3; ln 3.)
Answer: 4
Working: The gradient is the power, 4.
Related lessons
- Previous lesson: 8.3 Exponential Functions and Mathematical Modelling
- Next lesson: 9.1 The Binomial Theorem
- In this chapter: 8.1 Graphs of Exponential Functions
- In this chapter: 8.2 Graphs of Logarithms
Continue in the full course
This lesson is section 8.4 of our free OCR A-level Maths Year 1 (AS) course. In the full course you get every video for this section, an animated interactive lesson, a self-marking practice quiz, a printable worksheet with a mark scheme, an end-of-chapter test and your progress saved.
Continue lesson 8.4 in the free course →