Exponential Models
Not every relationship is a straight line — logarithms can turn a curve into one your regression toolkit can handle.
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:
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$.
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$.
Exponential data: $y=kb^x$
A different substitution is needed for exponential growth or decay. Taking logs of $y=kb^x$:
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$.
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$.
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
| Temperature, $t\,(^\circ\text{C})$ | 3 | 5 | 6 | 8 | 9 | 11 |
|---|---|---|---|---|---|---|
| Growth rate, $g$ | 1.04 | 1.49 | 1.79 | 2.58 | 3.1 | 4.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}$
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$
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$.