InfyCalculator
📊

Exponential Regression Calculator: Fit y = a·bˣ or y = a·eᵏˣ to Your Data

Fit an exponential curve y = a·bˣ (or a·eᵏˣ) to your data by least squares: coefficients, growth rate, doubling time or half-life, R², predictions, residual table and chart.

x values
y values
Show the equation as
Predict y at x =
Fitting method
Loading calculator…

How it works

Model: y = a·bˣ = a·eᵏˣ, with b = eᵏ · Linearise: ln y = ln a + k·x · k = (nΣx·ln y − Σx·Σln y) ÷ (nΣx² − (Σx)²) · ln a = (Σln y − k·Σx) ÷ n · Growth per unit = (b − 1) × 100% · Doubling time = ln 2 ÷ k (half-life = ln 2 ÷ |k| when k < 0) · R² = 1 − SSE ÷ SST

Exponential regression finds the curve y = a·bˣ that best matches a set of points whose y values grow or shrink by a roughly constant factor for each step in x: populations, compound interest, bacterial counts, radioactive decay, cooling or viral spread. Taking the natural log turns the curve into a straight line, ln y = ln a + k·x, so ordinary linear least squares on the points (x, ln y) gives the slope k and intercept ln a. Then a = e^(intercept) and b = e^k. This is what Excel’s exponential trendline and LOGEST, the TI-84 ExpReg command and most online calculators do, so your coefficients will match theirs. You get both forms of the equation, the growth or decay rate per unit of x, the doubling time or half-life, a prediction at any x, R² for the straight-line fit to ln y (the value spreadsheets show) and R² on the original y values, plus a residual table and a chart of data against the fitted curve. Under More options you can switch to a nonlinear least-squares fit on y itself, which weights the largest values more and can give a better R² in y. Unlike the 2-point exponential fit, which passes exactly through two points, this uses all your data; unlike linear regression, it assumes a constant percentage change, not a constant amount. All y values must be positive.

Worked example

With x = 1 to 9 and y = 3, 5, 7, 11, 19, 28, 41, 67, 95, the natural logs of y give Σ ln y = 25.8006 and Σ x·ln y = 155.0797, with Σx = 45 and Σx² = 285. The slope is k = (9 × 155.0797 − 45 × 25.8006) ÷ (9 × 285 − 45²) = 0.43461 and ln a = (25.8006 − 0.43461 × 45) ÷ 9 = 0.69370, so a = e^0.69370 = 2.0011 and b = e^0.43461 = 1.5444. The model is y = 2.0011 × 1.5444ˣ: y grows 54.44% per step and doubles every 1.5949 units of x. R² of the straight-line fit to ln y is 0.9984 (0.99579 on the original y values), and the prediction at x = 10 is 154.435.

Sources: Pima Open: Modeling exponential relationships with regression (worked examples) · Statology: Exponential regression calculator (example data and equation) · Omni Calculator: Exponential regression (log-linear method) · Mathwords: Exponential regression (bacteria example)

Frequently asked questions

How do you calculate exponential regression?

Take the natural log of every y value, run an ordinary linear regression of ln y on x, then convert back: a = e^(intercept) and b = e^(slope). The result is y = a·bˣ, the same answer as Excel’s exponential trendline and the TI-84 ExpReg.

What do a and b mean in y = a·bˣ?

a is the fitted value of y when x = 0, the starting amount. b is the growth factor: each time x goes up by 1, y is multiplied by b. b = 1.05 means 5% growth per unit of x, and b = 0.9 means 10% decay.

How do I convert between y = a·bˣ and y = a·eᵏˣ?

They are the same curve with k = ln b, or b = eᵏ. For b = 1.5444, k = ln 1.5444 = 0.4346. The continuous form is handy for doubling time, ln 2 ÷ k, and half-life, ln 2 ÷ |k|.

Why does my R² differ from another calculator?

Spreadsheets and the TI-84 report R² for the straight-line fit of ln y on x. R² measured on the original y values is usually a little different. This calculator shows both, and a nonlinear fit on y is available under More options.

Can I use exponential regression with zero or negative y values?

Not with the standard method, because the log of zero or a negative number does not exist. Remove or shift those points, or use a different model.

How many data points do I need?

At least 3. With exactly 2 points the curve passes through both and there is nothing to fit; the 2-point exponential fit calculator handles that case.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.