Statistics · Regression and Correlation · Year 2

Exponential Models

Not every relationship is a straight line — logarithms can turn a curve into one your regression toolkit can handle.

8 min read 1 worked example

Why some data needs coding first

A regression line and the product moment correlation coefficient both assume a linear relationship between two variables. Plenty of real relationships are not linear at all — population growth, radioactive decay, the relationship between a planet's orbital radius and its year length. Plotting the raw data still shows a clear pattern, just not a straight one.

The trick is coding: applying logarithms to turn a curved relationship into a straight one, so the whole toolkit of linear regression still applies. Which substitution you need depends on the shape of the underlying model.

Power law data: $y=ax^n$

Taking $\log$ of both sides of $y=ax^n$ and using the laws of logarithms:

$$\log y = \log a + n\log x$$

This is linear in $\log x$ and $\log y$. Coding with $Y=\log y$ and $X=\log x$ gives $Y=nX+\log a$ — a straight line with gradient $n$ and $Y$-intercept $\log a$.

If $y=ax^n$ for constants $a$ and $n$

then $\log y=\log a+n\log x$. Code $X=\log x$, $Y=\log y$. The gradient of the coded line is $n$; the intercept is $\log a$.

x y 2 4 6 8
The points satisfy $y=0.1x^{1.8}$ — a curve, not a straight line, so a linear regression line fitted directly to $(x,y)$ would be a poor model.
log x log y -1 O
Plotting $\log y$ against $\log x$ straightens the data: gradient $=1.8=n$, and the line crosses $\log x=0$ at $\log y=-1$, so $\log a=-1$ and $a=10^{-1}=0.1$.

Exponential data: $y=kb^x$

A different substitution is needed for exponential growth or decay. Taking logs of $y=kb^x$:

$$\log y = \log k + x\log b$$

Here $x$ itself is already linear — only $y$ needs logging. Coding with $Y=\log y$ and $X=x$ (unchanged) gives $Y=(\log b)X+\log k$: gradient $\log b$, intercept $\log k$.

If $y=kb^x$ for constants $k$ and $b$

then $\log y=\log k+x\log b$. Code $X=x$, $Y=\log y$. The gradient of the coded line is $\log b$; the intercept is $\log k$.

Telling the two models apart

The giveaway is whether $x$ needs logging too. In $y=ax^n$, $x$ is raised to a power, so both variables are logged ($X=\log x$). In $y=kb^x$, $x$ sits in the exponent, so only $y$ is logged and $x$ is coded as itself ($X=x$). Mixing the two up is the single most common error in this topic.

Worked example

Coding an exponential model and reversing it
The table shows the temperature, $t\,(^\circ\text{C})$, of a colony of bacteria and its growth rate, $g$.
Temperature, $t\,(^\circ\text{C})$3568911
Growth rate, $g$1.041.491.792.583.14.46

The data are coded using $x=t$ and $y=\log g$. The regression line of $y$ on $x$ is found to be $y=-0.2215+0.0792x$.

a — Explain why a constant of $-0.2215$ does not mean the colony is shrinking at $0^\circ\text{C}$

MethodUndo the coding to recover g, not y
1
When $t=0$, $x=0$, so the model gives $y=-0.2215$.
Substitute directly into the coded line.
2
But $y=\log g$, so $\log g=-0.2215$, giving $g=10^{-0.2215}=0.600$ (3 s.f.).
$y$ is not the growth rate — it's the logarithm of it.
3
A growth rate of $0.600$ is positive, so the model does not predict a shrinking colony.
Mika mistook the coded intercept for the real-world one.
▪ explained
Worth remembering

A negative constant in a coded regression line is completely ordinary — it's a logarithm, which is negative whenever the original quantity is between 0 and 1. Never read a coded coefficient as if it were the original variable.

b — Given that $g=kb^t$, find $k$ and $b$

MethodMatch the coded line to the general coded form
1
Substituting $x=t$, $y=\log g$: $\log g = -0.2215+0.0792t$.
This is exactly the coded line, in terms of the original variables.
2
Compare with $\log g=\log k+t\log b$: so $\log k=-0.2215$ and $\log b=0.0792$.
Matching coefficients with the general coded form for $g=kb^t$.
3
$k=10^{-0.2215}=0.600$ and $b=10^{0.0792}=1.20$ (3 s.f.).
Undo each logarithm by raising 10 to that power.
4
So $g=0.600\times1.20^t$.
The reconstructed exponential model.
▪ solved
Common mistake

A model prediction at $t=0$ (or any value outside the range of the collected data) is extrapolation — the model was only fitted to data between $t=3$ and $t=11$, and nothing guarantees the relationship still holds outside that range. Mika's claim would be shaky even before the coding error.

Check yourself

Data modelled by $y=ax^n$ is coded with $X=\log x$, $Y=\log y$, giving the regression line $Y=2.30+0.60X$. Find the values of $a$ and $n$.

1
Comparing $Y=2.30+0.60X$ with $\log y=\log a+n\log x$: $n=0.60$ and $\log a=2.30$.
2
$a=10^{2.30}=199$ (3 s.f.).
Undo the logarithm on the intercept only.