2.10 · AHL · HL onlyPaper 1Paper 2Paper 3

Logarithmic scales and linearizing data

In a minute

A spaces values by multiplying factors, so data from 0.010.01 to 1 000 0001\,000\,000 fit on one graph. Taking logs also straightens curved data: a straight line on a means an exponential model, and on a a power model. The line's and intercept give you the model's .

You'll be able to

  • Choose a logarithmic scale for data with a very wide range or when growth rates matter, and read values off a log axis.
  • Linearize exponential data by plotting ln⁡y\ln y against xx, then find kk and aa in y=kaxy = ka^{x} from the best-fit line.
  • Linearize power data by plotting ln⁡y\ln y against ln⁡x\ln x, then find kk and nn in y=kxny = kx^{n}.
  • Interpret the gradient and intercept of semi-log and log-log graphs in context.
  • Decide between an exponential and a power model by comparing rr for the two linearized data sets, and justify the choice.
Before you start3 quick questions on what this builds on
Check yourself
Which expression equals ln⁡(4x3)\ln\left(4x^{3}\right), for x>0x > 0?
Check yourself
Find log⁡10(3.2×105)\log_{10}\left(3.2 \times 10^{5}\right). Give your answer to 3 s.f.
Check yourself
A has r=−0.995r = -0.995. What does this tell you about the data?

Revise first: 1.1 Standard form, 1.5 Exponents and introductory logarithms, 1.9 Laws of logarithms, 2.1 Straight-line equations, 2.5 Modelling with functions, 2.6 Fitting and testing models and 4.4 Correlation and regression (y on x)

Logarithmic scales

Animal masses run from grams to over 100100 tonnes. On an ordinary axis, every small animal piles up at 00.

A fixes this. Each gridline is 1010 times the one before, so equal distances stand for equal multiplying factors, not equal differences.

1 ×10 10 ×10 100 ×10 1000 ×10 10 000 31.6 is halfway 55 sits here
Equal gaps are equal factors. The midpoint of the 1010 to 100100 gap is 101.5≈31.610^{1.5} \approx 31.6.

To read a log axis, use exponents: a point a fraction pp of the way from 10a10^{a} to 10a+110^{a+1} shows 10a+p10^{a + p}.

Worked exampleA chart shows the annual rainfall at weather stations on a log⁡10\log_{10} axis, in mm. One station's point sits a quarter of the way from the 100100 gridline to the 10001000 gridline. Find its rainfall, to 3 s.f.

Try it first, then reveal one step at a time.

  1. The 100100 gridline is at exponent 22 and the 10001000 gridline at exponent 33.
Worked exampleA pygmy shrew has mass 0.0040.004 kg and a blue whale 140 000140\,000 kg. On a log⁡10\log_{10} axis drawn with 1.51.5 cm for each power of ten, how far apart are the two animals? Give your answer to 3 s.f.

Try it first, then reveal one step at a time.

  1. Positions are log⁡10\log_{10} of the masses, so the gap is log⁡10140 000−log⁡100.004\log_{10} 140\,000 - \log_{10} 0.004.

Log scales also show growth rates. With a log vertical axis and time across, constant percentage growth is a straight line.

A steeper line means faster percentage growth, whatever the size of the numbers.

10 100 1000 10 000 100 000 0 10 20 30 40 days cases (log scale) A B
Country A has more cases, but country B's cases grow faster in percentage terms.
Check yourself
On a log⁡10\log_{10} axis, a point sits 60%60\% of the way from the 100100 gridline to the 10001000 gridline. What value does it show? Give your answer to 3 s.f.
Check yourself
In the figure above, which country's cases are growing faster in percentage terms?

Exponential data: semi-log graphs

means taking logs so that curved data lie on a straight line. You used the log laws for this in 1.9.

Suppose y=kaxy = ka^{x} with k>0k > 0 and a>0a > 0. Taking ln⁡\ln of both sides gives ln⁡y=ln⁡k+xln⁡a\ln y = \ln k + x\ln a. So ln⁡y\ln y against xx is a straight line.

Learn this
y=kax  ⇒  ln⁡y=(ln⁡a) x+ln⁡ky = ka^{x} \;\Rightarrow\; \ln y = (\ln a)\,x + \ln k

A graph of ln⁡y\ln y (or log⁡10y\log_{10} y) against xx is a . If its points lie close to a straight line with gradient mm and intercept cc, then a=ema = \mathrm{e}^{m} and k=eck = \mathrm{e}^{c}.

With ln⁡y\ln y, the model can also be written y=kemxy = k\mathrm{e}^{mx}. With log⁡10y\log_{10} y, use a=10ma = 10^{m} and k=10ck = 10^{c} instead.

Worked exampleA new online account's followers FF were counted each week. The graph of log⁡10F\log_{10} F against the week number ww is a straight line through (0,2.6)(0, 2.6) and (10,3.8)(10, 3.8). Write FF in the form kawka^{w}, and interpret aa.

Try it first, then reveal one step at a time.

  1. Gradient: m=3.8−2.610−0=0.12m = \frac{3.8 - 2.6}{10 - 0} = 0.12. Intercept: c=2.6c = 2.6. So log⁡10F=0.12w+2.6\log_{10} F = 0.12w + 2.6.
Worked exampleThe concentration CC (mg per litre) of a medicine in a patient's blood is measured tt hours after a dose. t123456C8.15.94.43.22.41.7\begin{array}{c|cccccc} t & 1 & 2 & 3 & 4 & 5 & 6 \\ \hline C & 8.1 & 5.9 & 4.4 & 3.2 & 2.4 & 1.7 \end{array} Find the regression line of ln⁡C\ln C on tt. Hence write CC in the form kebtk\mathrm{e}^{bt}, with kk and bb to 3 s.f.

Try it first, then reveal one step at a time.

  1. Take ln⁡\ln of every CC value: ln⁡8.1=2.0919…\ln 8.1 = 2.0919\ldots, ln⁡5.9=1.7749…\ln 5.9 = 1.7749\ldots, and so on. Enter tt in one list and ln⁡C\ln C in another.
Check yourself
Data give a semi-log line, ln⁡y\ln y on xx, sloping downwards. Which model fits the data?
Check yourself
A town's population PP, tt years after 2020, fits the line ln⁡P=0.042t+9.1\ln P = 0.042t + 9.1. By what percentage does the model's population grow each year? Give your answer to 3 s.f.

Power data: log-log graphs

Now suppose y=kxny = kx^{n}, with k>0k > 0 and x>0x > 0. Taking ln⁡\ln of both sides gives ln⁡y=ln⁡k+nln⁡x\ln y = \ln k + n\ln x. So ln⁡y\ln y against ln⁡x\ln x is a straight line.

Learn this
y=kxn  ⇒  ln⁡y=nln⁡x+ln⁡ky = kx^{n} \;\Rightarrow\; \ln y = n\ln x + \ln k

A graph that logs both axes is a . The gradient is the power nn. The intercept is ln⁡k\ln k (or log⁡10k\log_{10} k if both axes use base 1010).

A power model can have any nn, such as 0.750.75. When nn is a positive integer it is , and when nn is a negative integer it is (2.5). n=2n = 2 means doubling xx multiplies yy by 44.

1 1 10 10 100 100 1000 1000 mass M (kg, log scale) metabolic rate B (W, log scale) (1, 3.4) (100, 108)
On log-log axes, a straight line means B=kMnB = kM^{n}.
Worked exampleFor mammals, a log-log graph of resting metabolic rate BB (watts) against body mass MM (kg) is a straight line through the points (1,3.4)(1, 3.4) and (100,108)(100, 108), as in the figure. Find nn in B=kMnB = kM^{n}, then estimate BB for a 4040 kg mammal, to 3 s.f.

Try it first, then reveal one step at a time.

  1. The axes are logged, so find the gradient from the logs of the coordinates: n=log⁡10108−log⁡103.4log⁡10100−log⁡101=log⁡1031.76…2=0.75097…n = \frac{\log_{10} 108 - \log_{10} 3.4}{\log_{10} 100 - \log_{10} 1} = \frac{\log_{10} 31.76\ldots}{2} = 0.75097\ldots
Worked exampleAn engineer records the blade length LL (m) and the rated power PP (kW) of six wind turbines. L102030456080P3312029064011902050\begin{array}{c|cccccc} L & 10 & 20 & 30 & 45 & 60 & 80 \\ \hline P & 33 & 120 & 290 & 640 & 1190 & 2050 \end{array} Use power regression to write PP in the form kLnkL^{n}, with kk and nn to 3 s.f. Interpret nn.

Try it first, then reveal one step at a time.

  1. Enter LL and PP as lists. Power regression fits a straight line to ln⁡P\ln P against ln⁡L\ln L.
Check yourself
A log-log line is ln⁡y=1.5ln⁡x+0.4\ln y = 1.5\ln x + 0.4, for x>0x > 0. Which equation gives yy?
Check yourself
A log-log graph of a radio signal's strength SS against distance dd km from the mast is a straight line with gradient −2-2. When d=2d = 2, S=45S = 45. Find SS when d=5d = 5.

Exponential or power? Choosing the model

To decide which model fits, linearize the data both ways and see which graph is straighter.

1. Plot ln⁡y\ln y against xx (semi-log). Straight means exponential.

2. Plot ln⁡y\ln y against ln⁡x\ln x (log-log). Straight means power.

3. Compare rr, , for the two transformed data sets. Choose the one with ∣r∣|r| closer to 11, then use its for the .

Find rr for the transformed data, not the raw data. If neither graph is close to straight, neither model fits well.

Worked exampleA messaging app's users UU (thousands) are recorded mm months after launch. An analyst fits two lines. Graph A, ln⁡U\ln U against mm: gradient 0.1860.186, intercept 1.621.62, r=0.997r = 0.997. Graph B, ln⁡U\ln U against ln⁡m\ln m: gradient 1.341.34, intercept 1.051.05, r=0.951r = 0.951. Choose the better model, justify your choice, and write it as U=kebmU = k\mathrm{e}^{bm} or U=kmnU = km^{n}.

Try it first, then reveal one step at a time.

  1. Graph A has r=0.997r = 0.997, closer to 11 than Graph B's 0.9510.951, so the semi-log graph is straighter.
Worked exampleA club runner's best times TT (minutes) over distances dd (km) are shown. d1.551021.142.2T4.617.035.277.5165.0\begin{array}{c|ccccc} d & 1.5 & 5 & 10 & 21.1 & 42.2 \\ \hline T & 4.6 & 17.0 & 35.2 & 77.5 & 165.0 \end{array} Decide whether an exponential or a power model fits better, giving a reason. Use it to estimate the runner's time for 3030 km, to 3 s.f.

Try it first, then reveal one step at a time.

  1. Semi-log: rr for ln⁡T\ln T against dd is 0.90260…0.90260\ldots
Check yourself
For a data set, r=0.981r = 0.981 for ln⁡y\ln y against xx, and r=0.912r = 0.912 for ln⁡y\ln y against ln⁡x\ln x. Which model should you choose?
Check yourself
Hot soup cools in a room at 20 ∘C20\,^{\circ}\mathrm{C}. Its temperature is modelled by T=kat+20T = ka^{t} + 20. Before you fit kk and aa from the data by taking logs, what should you do?

Common mistakes

  • Running a linear regression of yy on xx when the question asks for ln⁡y\ln y on xx. Take ln⁡\ln of every yy value first; a line through the raw data is the wrong model.
  • Using the intercept cc as kk. On a graph of ln⁡y\ln y the intercept is ln⁡k\ln k, so k=eck = \mathrm{e}^{c}; with log⁡10y\log_{10} y it is k=10ck = 10^{c}.
  • Rounding the gradient or intercept before you undo the logs. Small changes in an exponent change kk and predictions a lot, so keep the GDC's full values.
  • Choosing a model with no reason. Quote rr (or r2r^{2}) for both linearized graphs and choose the one closer to ±1\pm 1.
  • Reading a log axis as linear. Halfway between the 1010 and 100100 gridlines is 101.5≈31.610^{1.5} \approx 31.6, not 5555.

Exam tips

  • “Find the regression line in the form ln⁡y=ax+b\ln y = ax + b”: write that you took ln⁡\ln of the yy values, then give the equation with ln⁡y\ln y on the left and aa and bb to 3 s.f.
  • “Justify” a choice of model: state rr or r2r^{2} for both linearized graphs and say which is closer to 11 in size. A choice without a valid reason earns no marks.
  • “Interpret” a semi-log gradient mm through its factor per unit of xx, em\mathrm{e}^{m} (or 10m10^{m} with log⁡10\log_{10}), in context: “the concentration falls by about 27%27\% each hour”.
  • You won't be asked to draw or sketch log graphs, but you must read them. First check whether each axis shows the value or its log, and which base.

Key takeaways

Learn thisOn a log⁡10\log_{10} scale, equal steps are equal factors. A point a fraction pp of the way from 10a10^{a} to 10a+110^{a+1} shows 10a+p10^{a+p}.
Learn thisWith a log vertical axis and time across, a straight line means a constant percentage rate of change (growth if it rises, decay if it falls), and a steeper rising line means faster percentage growth.
Learn thisIf y=kaxy = ka^{x} with k,a>0k, a > 0, then ln⁡y=(ln⁡a)x+ln⁡k\ln y = (\ln a)x + \ln k: straight on a semi-log graph, with a=egradienta = \mathrm{e}^{\text{gradient}} and k=einterceptk = \mathrm{e}^{\text{intercept}}.
Learn thisIf y=kxny = kx^{n} with k>0k > 0 and x>0x > 0, then ln⁡y=nln⁡x+ln⁡k\ln y = n\ln x + \ln k: straight on a log-log graph, with n=n = gradient and k=einterceptk = \mathrm{e}^{\text{intercept}}.
Learn thisWith log⁡10\log_{10} in place of ln⁡\ln, undo the logs with powers of 1010: k=10interceptk = 10^{\text{intercept}}, and a=10gradienta = 10^{\text{gradient}} for an exponential model.
Learn thisTo choose between exponential and power models for positive data, find rr for ln⁡y\ln y against xx and for ln⁡y\ln y against ln⁡x\ln x. Choose the one with ∣r∣|r| closer to 11, and say so.
Learn thisKeep the GDC's full gradient and intercept until you have undone the logs. Round only the final parameters and predictions.

Practise this

15 past-paper questions on Non-linear regression and linearizing in the AI HL bank, each with a mark scheme and a worked explanation.

Practise Non-linear regression and linearizing →