How it’s calculated
Exponential regression fits a curve y = a·e^(bx) to data that grow (or decay) by a roughly constant percentage for each step in x. Taking natural logs turns the curve into a straight line, ln y = ln a + b·x, so the calculator fits that line by ordinary least squares and converts back. This is the same method as the ExpReg command on graphing calculators, which reports the curve as y = a·Bˣ with B = e^b.
About R². Because the line is fitted to ln y, the R² shown is the R² of that log-scale line: how close the points are to a straight line once y is logged. It is not the share of the variation in the original y values that the curve explains, and it can look good even when the curve misses the largest y values by a lot in absolute terms. Least squares on ln y also gives relatively more weight to the small y values than a direct (nonlinear) fit of y = a·e^(bx) would, so the two methods give slightly different curves.
Example (OpenStax College Algebra 2e, §6.8, Example 1): blood alcohol content (x) and relative risk of crashing (y), 12 points. ExpReg gives y = 0.58304829 × (2.20720213 × 10¹⁰)ˣ with r² ≈ 0.97. In e-form that is a = 0.583048 and b = ln(2.20720213 × 10¹⁰) ≈ 23.8176. At a BAC of 0.16 the model predicts a relative risk of about 26.35. These are the default values.
Frequently asked questions
Why must every y be positive?
The curve a·e^(bx) with a positive a is always above zero, and the fit uses ln y, which is undefined for 0 or negative numbers. If your data include zeros, consider adding a constant or using a different model.
Why is R² “on the log scale”?
Because the straight line is fitted to ln y. The R² describes that log-scale line, not how much of the variation in y itself is explained. Check a plot of the curve against your data too.
How do I get the form y = a·bˣ?
Use the growth factor e^b shown in the results as the base: y = a·(e^b)ˣ. For example, b = 0.0693 gives a growth factor of 1.0718, about 7.18% growth per unit of x.
Is this the same as fitting y = a·e^(bx) directly?
Not quite. A direct nonlinear least-squares fit minimises errors in y, while this log-linear method minimises errors in ln y (relative errors). Results are close when the data follow the curve well.
Embed this calculator
Add this free calculator to your own website. Copy the code below into your page’s HTML:
Need this calculator branded, changed or built around your own prices?See custom business solutions →
Sources
- College Algebra 2e, §6.8 Fitting Exponential Models to Data — OpenStax
- Handbook of Biological Statistics (McDonald), 5.3 Curvilinear (Nonlinear) Regression (transforming to a straight line) — LibreTexts
Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.
Added · Last updated · How we check our calculators
Spotted a mistake or missing option? Report a problem· Suggest a calculator