Exponential Regression Calculator

Fit y = a·e^(bx) to data by a straight-line fit of ln y: a, b, growth factor, doubling or half-life, R² on the log scale and a prediction.

Use a point for decimals (1.5), no thousands separators, and separate numbers with spaces or a comma and a space.
Every y must be greater than 0, because the fit uses ln y. Up to 1000 points.

Results

Best-fit curve
y = 0.583048 · e^(23.8176x)
a (value of the curve at x = 0)
0.583048
b (continuous growth rate per unit of x)
23.818
Growth factor per unit of x, e^b (the “b” in y = a·bˣ)
2.2072 × 10¹⁰
Change per unit of x
× 2.2072 × 10¹⁰ per unit
Doubling time, ln 2 ÷ b (in units of x)
0.0291023
R² of the fit to ln y (log scale)
0.9712
Measures how straight the points are on a log scale, not the share of variation in y itself.
Correlation r between x and ln y
0.9855
Predicted y at x = 0.16
26.346
Number of points
12

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.

fit the line ln y = A + b·x by least squares: b = Σ(x − x̄)(ln y − mean of ln y) / Σ(x − x̄)² A = mean of ln y − b·x̄, a = e^A y = a·e^(bx) = a·Bˣ with B = e^b doubling time = ln 2 / b (b > 0); half-life = ln 2 / |b| (b < 0)

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

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