Exponential Regression Calculator

Fit the best exponential curve y = a·b^x to your data by least squares. Enter your (x, y) points to get the coefficients a and b, the R² fit quality, and a predicted y.

Quick Facts

Method
Least-squares fit of y = a·b^x via ln(y) = ln(a) + x·ln(b)
Linearizes by taking natural log of y, then runs ordinary linear regression on (x, ln y).

Your Results

Calculated
Fitted equation
-
y = a·b^x
Coefficient a
-
y-value at x = 0
Base b
-
Growth/decay factor per unit x
R² (fit quality)
-
Fraction of variation explained
Predicted y
-
At the x you entered

Ready

Enter your x and y data, then run the fit.

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 + c where Y = ln(y), slope m = ln(b), and intercept c = 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)²] and c = [Σ(ln y) − m·Σx] / n.
  • Convert back: a = ec and b = em. If you prefer the base-e form, y = a·ekx with k = 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).

Frequently Asked Questions

When should I use exponential regression instead of linear or power regression?
Use exponential regression when y changes by a constant percentage for each equal step in x — a straight line on a semi-log plot (linear x-axis, logarithmic y-axis). Use linear regression when y changes by a constant amount per step, and power regression (y = a·xb) when the data is straight on a log-log plot. Plotting your data on a semi-log axis is the quickest visual test: if the points fall on a line, an exponential model fits.
Why must all my y values be positive?
The fit is computed by taking the natural log of each y value, and ln(y) is only defined for y > 0. A single zero or negative y makes the calculation impossible, so this tool rejects such data. If your real data can be zero or negative, exponential regression is the wrong model — consider adding a fitted offset (y = a·bx + c, which needs non-linear least squares) or a different curve entirely.
Does log-linearization give the same answer as true non-linear least squares?
Not exactly. Log-linearization minimizes the squared error of ln(y), which weights small y values more heavily and effectively assumes multiplicative (constant-percentage) error. True non-linear least squares minimizes squared error in y directly. The two agree closely when the data follows the exponential shape tightly, but can differ noticeably with scattered data. The linearized method used here is the standard textbook and spreadsheet approach (it matches Excel's LOGEST / GROWTH functions).