Understanding the exponential regression calculator — concept and principle
This calculator fits an exponential model y = a·bˣ to data points by least squares on the logarithms of y. It reports a, b, the percent change per unit of x, the continuous rate, the same model with base e, a prediction, r² and the doubling time or half-life. It is the same method as the ExpReg key on graphing calculators and exponential trendlines in spreadsheets.
How it is calculated
ln y = ln a + x·ln b, a straight line in x
Fit ln y on x by ordinary least squares; then b = e^slope and a = e^intercept
Change per unit of x = (b − 1) × 100 %; k = ln b; doubling time = ln 2 ÷ |k|
- r² is computed on the log scale, where the fit is made.
- All y values must be positive.
The principle
Taking logarithms turns multiplication into addition, so a curve that multiplies by b for each unit of x becomes a straight line with slope ln b. Fitting a line is simple and well understood. The catch is that errors are minimised for ln y, not for y itself, which gives relatively more weight to small y values than a direct non-linear fit would; the two methods usually give similar but not identical curves.
Worked example
Default inputs: x = 0 … 5, y = 3.1, 4.4, 6.5, 9.2, 13.8, 19.9; predict at x = 7.
- Fitted model: y = 3.06312 · 1.45284ˣ; a = 3.06312, b = 1.45284.
- Change per unit of x = 45.28 %; continuous rate k = 0.373519, so y = 3.06312 · e^(0.373519x).
- r² (ln y on x) = 0.999644; correlation of x and ln y 0.999822.
- Prediction at x = 7: 3.06312 × 1.45284⁷ = 41.8491.
- Doubling time = ln 2 ÷ 0.373519 = 1.856 units of x.
How to read the result
y grows by about 45 % per unit of x and doubles roughly every 1.86 units. The very high r² says the points lie almost on a straight line on a log scale. The prediction at x = 7 is two steps beyond the data; the further you go, the more a small error in b is multiplied.
Common mistakes
- Including zero or negative y values.
- Comparing r² on the log scale with r² of a linear fit on the original scale as if they were the same measure.
- Extrapolating far beyond the data.
- Reading b as the percent change; the change is b − 1.
Frequently asked questions
How does exponential regression work?
It fits a straight line to ln y against x, then converts the slope and intercept back to b and a.
Why must y be positive?
The logarithm of zero or a negative number is not defined.
What does b = 1.45 mean?
y is multiplied by 1.45, a 45 % increase, for each unit of x.
Sources: NIST/SEMATECH e-Handbook of Statistical Methods, §4.1.4.1 Linear Least Squares Regression