Skip to content

Linearising exponential and power data

Linearising data means transforming variables so that a proposed nonlinear relationship becomes a straight-line relationship. A straight line is easier to recognise and analyse because its gradient and intercept reveal the parameters of the original model.

The two central results are

y=Abxlny=xlnb+lnA\boxed{y=Ab^x\quad\Longrightarrow\quad \ln y=x\ln b+\ln A}

and

y=Axnlny=nlnx+lnA.\boxed{y=Ax^n\quad\Longrightarrow\quad \ln y=n\ln x+\ln A.}

They look similar, but require different graphs. For an exponential model, plot lny\ln y against xx. For a power model, plot lny\ln y against lnx\ln x.

You should be able to:

A straight line has the form

Y=mX+c,Y=mX+c,

where XX is the horizontal variable, YY is the vertical variable, mm is the gradient and cc is the vertical intercept.

Linearisation does not claim that the original graph of yy against xx is straight. It defines transformed variables XX and YY so that the transformed equation has the form Y=mX+cY=mX+c.

The comparison with Y=mX+cY=mX+c should always be explicit. It prevents the most common error: reading the correct gradient from the wrong axes.

Suppose

y=Abx,y=Ab^x,

where A>0A>0, b>0b>0 and b1b\ne1. Taking natural logarithms gives

lny=ln(Abx)=lnA+ln(bx)=lnA+xlnb.\begin{aligned} \ln y&=\ln(Ab^x)\\ &=\ln A+\ln(b^x)\\ &=\ln A+x\ln b. \end{aligned}

Rearrange this as

lnyY=lnbmxX+lnAc.\underbrace{\ln y}_{Y} =\underbrace{\ln b}_{m}\underbrace{x}_{X} +\underbrace{\ln A}_{c}.

Therefore a plot of lny\ln y on the vertical axis against xx on the horizontal axis should be a straight line with

m=lnb,c=lnA.m=\ln b, \qquad c=\ln A.

Recover the original parameters by undoing the logarithms:

b=em,qquadA=ec.\boxed{b=e^m,qquad A=e^c.}

If the original model is written as y=Aekxy=Ae^{kx}, then

lny=kx+lnA,\ln y=kx+\ln A,

so the gradient is directly kk.

The variables xx and yy are believed to satisfy

y=7(1.4)x.y=7(1.4)^x.

Find the equation of the straight line obtained by plotting lny\ln y against xx.

Take natural logarithms:

lny=ln7+xln1.4.\ln y=\ln 7+x\ln 1.4.

Hence the straight-line equation is

lny=0.33647x+1.94591.\ln y=0.33647\ldots x+1.94591\ldots.

The gradient is positive because 1.4>11.4>1, so the original model represents growth.

Worked example 2: recover an exponential model

Section titled “Worked example 2: recover an exponential model”

A plot of lny\ln y against xx produces the line

lny=1.70.24x.\ln y=1.7-0.24x.

Write the relationship between xx and yy in the forms y=Aekxy=Ae^{kx} and y=Abxy=Ab^x.

Exponentiate both sides:

y=e1.70.24x=e1.7e0.24x.\begin{aligned} y&=e^{1.7-0.24x}\\ &=e^{1.7}e^{-0.24x}. \end{aligned}

Therefore

y=5.4739e0.24x,y=5.4739\ldots e^{-0.24x},

so, to three significant figures,

y=5.47e0.24x.\boxed{y=5.47e^{-0.24x}.}

For the form y=Abxy=Ab^x,

b=e0.24=0.7866,b=e^{-0.24}=0.7866\ldots,

giving

y=5.47(0.787)x.\boxed{y=5.47(0.787)^x.}

The negative gradient means 0<b<10<b<1, which is consistent with exponential decay.

Worked example 3: linearise a table of data

Section titled “Worked example 3: linearise a table of data”

The following measurements are believed to follow y=Aekxy=Ae^{kx}.

xx00224466
yy3.003.004.484.486.686.689.969.96

Add a row of transformed values, keeping enough decimal places for the calculation:

xx00224466
lny\ln y1.0991.0991.4991.4991.8991.8992.2992.299

The increments in lny\ln y are approximately constant for equal increments in xx, so a plot of lny\ln y against xx is approximately linear.

Using the first and last transformed points,

m2.2991.09960=0.200.m\approx\frac{2.299-1.099}{6-0}=0.200.

The intercept is approximately 1.0991.099, so

k0.200,Ae1.099=3.00.k\approx0.200, \qquad A\approx e^{1.099}=3.00.

The model is therefore

y3.00e0.200x.\boxed{y\approx3.00e^{0.200x}.}

With real data, use all the transformed points in a linear regression rather than estimating from two arbitrarily chosen data points.

Suppose

y=Axn,y=Ax^n,

where A>0A>0 and, for logarithms, x>0x>0 and y>0y>0. Taking natural logarithms gives

lny=ln(Axn)=lnA+nlnx.\begin{aligned} \ln y&=\ln(Ax^n)\\ &=\ln A+n\ln x. \end{aligned}

Now compare with Y=mX+cY=mX+c:

lnyY=nmlnxX+lnAc.\underbrace{\ln y}_{Y} =\underbrace{n}_{m}\underbrace{\ln x}_{X} +\underbrace{\ln A}_{c}.

Therefore a plot of lny\ln y against lnx\ln x should be a straight line with

n=m,qquadA=ec.\boxed{n=m,qquad A=e^c.}

The gradient is the power itself. This is the key distinction from an exponential model.

A plot of lny\ln y against lnx\ln x has gradient 1.61.6 and vertical intercept 0.7-0.7. Find the model y=Axny=Ax^n.

Since the gradient equals nn,

n=1.6.n=1.6.

Since the intercept equals lnA\ln A,

lnA=0.7\ln A=-0.7

and therefore

A=e0.7=0.496585.A=e^{-0.7}=0.496585\ldots.

Thus

y0.497x1.6.\boxed{y\approx0.497x^{1.6}.}

Do not set A=0.7A=-0.7. The intercept is lnA\ln A, not AA.

Worked example 5: use two transformed points

Section titled “Worked example 5: use two transformed points”

Variables xx and yy satisfy y=Axny=Ax^n. On a graph of log10y\log_{10}y against log10x\log_{10}x, the straight line passes through (0,0.4)(0,0.4) and (2,3.0)(2,3.0). Find AA and nn.

The gradient is

n=3.00.420=1.3.n=\frac{3.0-0.4}{2-0}=1.3.

The intercept is

log10A=0.4,\log_{10}A=0.4,

so

A=100.4=2.5118.A=10^{0.4}=2.5118\ldots.

Therefore

y2.51x1.3.\boxed{y\approx2.51x^{1.3}.}

This example uses base 1010 rather than base ee. The method is unchanged, but the inverse operation must match the logarithm used: A=10cA=10^c for common logarithms and A=ecA=e^c for natural logarithms.

For a particular material, breaking load FF is modelled by F=AdnF=Ad^n, where dd is diameter. A log-log regression gives

lnF=2.08lnd+3.15.\ln F=2.08\ln d+3.15.

Find the model and estimate FF when d=4.5d=4.5.

Comparing with

lnF=nlnd+lnA,\ln F=n\ln d+\ln A,

gives

n=2.08,A=e3.15=23.336.n=2.08, \qquad A=e^{3.15}=23.336\ldots.

Hence

F23.336d2.08.F\approx23.336d^{2.08}.

At d=4.5d=4.5,

F23.336(4.5)2.08=533.7.F\approx23.336(4.5)^{2.08}=533.7\ldots.

Therefore

F534\boxed{F\approx534}

in the stated units. Use the unrounded values of AA and nn in the final calculation if they are available.

Proposed modelLinear formHorizontal axisVertical axisGradientIntercept
y=mx+cy=mx+cy=mx+cy=mx+cxxyymmcc
y=Abxy=Ab^xlny=(lnb)x+lnA\ln y=(\ln b)x+\ln Axxlny\ln ylnb\ln blnA\ln A
y=Aekxy=Ae^{kx}lny=kx+lnA\ln y=kx+\ln Axxlny\ln ykklnA\ln A
y=Axny=Ax^nlny=nlnx+lnA\ln y=n\ln x+\ln Alnx\ln xlny\ln ynnlnA\ln A

The phrase plot PP against QQ means put PP on the vertical axis and QQ on the horizontal axis.

If both an exponential and a power model seem plausible:

  1. plot lny\ln y against xx to test an exponential model;
  2. plot lny\ln y against lnx\ln x to test a power model;
  3. compare the patterns of residuals and the strength of the linear fits;
  4. use the context and mechanism, not correlation alone, to select a model.

A high correlation coefficient for transformed data supports linearity over the observed range. It does not prove that the proposed law is true for all values.

For transformed data, enter the appropriate transformed variables into two calculator lists and perform linear regression in the form

Y=a+bX.Y=a+bX.

Calculator letters vary, so translate the output by meaning:

  • bb is the gradient;
  • aa is the vertical intercept;
  • the original parameters follow from the comparison table above.

Record more digits than the final answer requires. Premature rounding of logarithms, gradients or intercepts can noticeably change the recovered model.

If a question asks you to draw a line of best fit by hand, choose two well-separated points on the line, not necessarily two measured data points. Then calculate

m=Y2Y1X2X1.m=\frac{Y_2-Y_1}{X_2-X_1}.

Widely separated points reduce the effect of reading error.

To calculate lnx\ln x and lny\ln y as real numbers, both xx and yy must be positive. Zero and negative observations cannot simply be included in a logarithmic transformation.

This does not automatically mean the underlying situation is impossible. It means that this particular transformation and model need reconsideration. A shifted model such as y=C+Abxy=C+Ab^x does not become linear merely by plotting lny\ln y against xx because

ln(C+Abx)lnC+ln(Abx).\ln(C+Ab^x)\ne \ln C+\ln(Ab^x).

Strictly, a logarithm acts on a dimensionless ratio. In a data analysis, writing lnx\ln x is shorthand for logging the numerical value of xx in fixed stated units, or for ln(x/x0)\ln(x/x_0) using a reference value x0x_0.

Changing units can alter the intercept, and sometimes the numerical value of AA, but it does not alter the essential fitted relationship when conversions are handled consistently. Always state the units of the original variables and use one unit system throughout.

Transformation changes the error structure

Section titled “Transformation changes the error structure”

Least-squares regression on lny\ln y minimises vertical discrepancies in lny\ln y, not in yy. It is therefore especially natural when errors are proportional or multiplicative. A good transformed fit should still be checked against the original data and context.

An estimate within the observed range is an interpolation. An estimate beyond it is an extrapolation and is less reliable. Linear appearance after transformation does not justify extreme predictions.

”Taking logs makes any curve straight”

Section titled “”Taking logs makes any curve straight””

No. It makes particular model families straight. If the proposed model is unsuitable, the transformed points will still show curvature or another systematic pattern.

”The gradient of lny\ln y against xx is the base”

Section titled “”The gradient of ln⁡y\ln ylny against xxx is the base””

For y=Abxy=Ab^x, the gradient is lnb\ln b, so b=emb=e^m. The gradient is directly the exponent coefficient only when the model is written y=Aekxy=Ae^{kx}.

”A power model needs only the yy values logged”

Section titled “”A power model needs only the yyy values logged””

For y=Axny=Ax^n, both variables must be logged:

lny=nlnx+lnA.\ln y=n\ln x+\ln A.

Plotting lny\ln y against xx tests an exponential model instead.

For both principal transformations, the intercept is lnA\ln A. Exponentiate it to recover AA.

”The base of the logarithm changes the power”

Section titled “”The base of the logarithm changes the power””

It does not. For a power model, the gradient is nn with any consistent logarithm base. Only the interpretation of the intercept changes from A=ecA=e^c to A=10cA=10^c, for example.

Which graph should be linear if y=6(0.8)xy=6(0.8)^x?

Answer

Plot lny\ln y vertically against xx horizontally. The line has gradient ln0.8<0\ln 0.8<0 and intercept ln6\ln 6.

A plot of lny\ln y against xx has gradient 0.350.35 and intercept 1.21.2. Find the model in the form y=Aekxy=Ae^{kx}.

Answer k=0.35,A=e1.2=3.3201.k=0.35, \qquad A=e^{1.2}=3.3201\ldots.

Therefore

y3.32e0.35x.y\approx3.32e^{0.35x}.

A plot of log10y\log_{10}y against log10x\log_{10}x has equation

log10y=2.4log10x0.3.\log_{10}y=2.4\log_{10}x-0.3.

Find AA and nn in y=Axny=Ax^n.

Answer

The gradient gives n=2.4n=2.4. The intercept gives

log10A=0.3,\log_{10}A=-0.3,

so

A=100.3=0.5012.A=10^{-0.3}=0.5012\ldots.

Thus y0.501x2.4y\approx0.501x^{2.4}.

A student linearises y=Axny=Ax^n and writes lny=nlnx+A\ln y=n\ln x+A. What has gone wrong?

Answer

They have treated lnA\ln A as AA. The correct transformation is

lny=nlnx+lnA.\ln y=n\ln x+\ln A.

The correlation coefficient between xx and lny\ln y is 0.998-0.998. What does this suggest, and what does it not prove?

Answer

It suggests that an exponential decay model may fit the observed range very well because lny\ln y is strongly and negatively linearly related to xx. It does not prove causation, establish the mechanism, or guarantee reliable extrapolation outside the data range.

Before finishing a linearisation question, check that you have:

  • taken logarithms of the complete model;
  • expanded them using the log laws correctly;
  • identified the transformed XX and YY variables;
  • compared the equation explicitly with Y=mX+cY=mX+c;
  • interpreted the gradient and intercept for the stated model;
  • undone the logarithm using the matching base;
  • kept unrounded calculator values until the final answer;
  • stated the final model in the requested form;
  • commented on fit and extrapolation only as strongly as the evidence allows.