Understanding exponential regression
Exponential regression finds the curve y = a·bx that best fits a set of (x, y) data points. It is the right tool when a quantity multiplies by a roughly constant factor over equal steps of x — populations, compound interest, radioactive decay, bacterial growth, cooling, and the early phase of an epidemic all follow this shape. The coefficient a is the value of y when x = 0, and the base b is the multiplier applied for every one-unit increase in x: if b = 2 the quantity doubles each step, if b = 0.5 it halves each step.
The formula, step by step
You cannot fit a·bx directly with straight-line least squares, so the model is linearized by taking the natural logarithm of both sides:
- Start with
y = a·bx. - Take ln of both sides:
ln(y) = ln(a) + x·ln(b). - This is a straight line
Y = m·x + cwhereY = ln(y), slopem = ln(b), and interceptc = ln(a). - Run ordinary least-squares linear regression on the points (x, ln y). The standard formulas give
m = [n·Σ(x·ln y) − Σx·Σ(ln y)] / [n·Σx² − (Σx)²]andc = [Σ(ln y) − m·Σx] / n. - Convert back:
a = ecandb = em. If you prefer the base-e form,y = a·ekxwithk = ln(b) = m.
Because the fit works on ln(y), every y value must be strictly positive — the logarithm of zero or a negative number is undefined. This calculator uses exactly these formulas and reports a, b, and the R² fit quality measured in the original y units.
A worked example
Take the points (1, 3), (2, 6), (3, 12), (4, 24), (5, 48). Each y is exactly double the previous one, so the data is perfectly exponential with base b = 2. Working the log-regression by hand gives slope m = ln 2 ≈ 0.6931 and intercept c = ln 1.5 ≈ 0.4055, so a = e0.4055 = 1.5 and b = e0.6931 = 2. The fitted curve is y = 1.5 · 2x, which reproduces every point exactly (R² = 1). Predicting at x = 6 gives 1.5 · 26 = 1.5 · 64 = 96.
Growth rate versus the base b
The base b converts directly to a percentage change per step. A base of b = 1.05 means 5% growth per unit of x; b = 0.90 means 10% decay per unit. In compound terms, the constant k = ln(b) is the continuous growth rate. The "doubling time" of a growing process is ln(2)/ln(b) units of x, and the "half-life" of a decaying process is ln(0.5)/ln(b).