Exponential Regression Calculator
Calculate exponential regression with instant, accurate results and clear step-by-step output.
Independent variable: time, dose, generation, distance. Must be the same length as Y.
Dependent variable — must be strictly positive (ln requires y > 0). The number of values must match X.
Optional — value of x at which to predict y using the fitted model. Leave blank to skip.
About
Exponential regression fits a model y = a · e^(bx) to a set of (x, y) data points, where y must be strictly positive. The parameter a is the value of y at x = 0 (the initial value), and b is the continuous growth rate (per unit x). For b > 0 the data is growing exponentially; for b < 0 it is decaying. The fit itself is done by linearising the data: take the natural log of y, then run ordinary least-squares regression on (x, ln y). The slope of that fit is b; the intercept is ln(a); exponentiate to recover a.
The linearisation works because ln is the inverse of exp. Applying ln to both sides of y = a · e^(bx) gives ln(y) = ln(a) + b · x — a linear equation in x with slope b and intercept ln(a). The same trick works for power-law fits: log both sides of y = a · x^n and you get ln(y) = ln(a) + n · ln(x), again linear. This is the unifying idea behind transformation-based regression — choose the transform that linearises the model you want.
The closed-form ordinary least-squares solution on the linearised data is: slope b = Σ((x − x̄)(lny − lnȳ)) / Σ((x − x̄)²), and intercept ln(a) = lnȳ − b · x̄. These are the standard linear-regression formulas applied to (x, lny) pairs. Then a = exp(intercept). The R² is computed on the linearised fit: 1 − SSE/SST where SSE and SST are sums of squared errors of ln(y) against the linearised prediction. R² = 1 is perfect; R² = 0 is no better than the mean.
There is a subtle bias in the linearised fit: you minimise squared error on ln(y), not on y. For data spanning many orders of magnitude, this is actually appropriate (it weights relative errors, not absolute errors). For data with small noise around large values, the bias correction σ̂²/2 (added to ln(a)) recovers an unbiased estimate of a. In practice, for most scientific data the bias is small and the linearised fit is the standard tool — used in every chemistry, biology, and finance textbook.
Exponential regression is the right tool whenever the fractional rate of change is constant — that is, when the data grows (or decays) by a fixed percentage per unit time. Population biology (bacteria doubling every 20 minutes), epidemiology (early-stage epidemic growth — COVID-19 cases in March 2020 grew at b ≈ 0.21/day, doubling every 3.3 days), finance (compound interest, inflation, asset prices over short horizons), chemistry (first-order reaction kinetics, radioactive decay fits), pharmacology (drug elimination, first-order kinetics), Moore's law (transistor count doubling every 2 years — fit b ≈ 0.346/year on data from 1971 to 2020). The common thread: rate proportional to current amount.
Watch for the moment when exponential regression fails: when growth starts to saturate (carrying-capacity limit), exponential regression diverges from the data and R² drops. At that point switch to logistic regression (curve-fitting sense): y = K / (1 + A · e^(−rt)) — the saturating extension of exponential growth. The same linearisation trick (using ln((K−y)/y) = ln(A) − rt) gives a closed-form fit if K is known; if not, use nonlinear least squares. Plot the residuals to see which model fits better — exponential regression residuals should look random; systematic curvature signals a missing feature.
How to Use
- 1Enter the X valuesType the independent-variable values separated by commas (e.g. 0, 1, 2, 3, 4, 5). Time, dose, generation, distance — any monotonically increasing variable. The order matters: each x is paired with the corresponding y.
- 2Enter the Y values (must be positive)Type the dependent-variable values separated by commas (e.g. 10, 22, 49, 110, 240, 530). All y must be strictly positive — the natural log requires it. The same number of x and y values must be entered.
- 3Optionally enter an x for predictionType a value of x at which you want to predict y using the fitted model. Useful for forecasting: if x is time and you fit past data, predict the next time point. Leave blank to skip prediction.
- 4Read the fit parameters a and bThe hero shows the fitted model y = a · e^(bx) with the a and b values. Below it: the R² goodness of fit, the prediction at your chosen x, the doubling time (or half-life if b < 0), and the slope/intercept of the linearised regression.
- 5Check the residuals and R²If R² is below 0.9, the exponential model is a poor fit — try logistic, linear, or polynomial regression instead. Use the comparison table to see typical (a, b, R²) values for textbook datasets like Moore's law and the early COVID outbreak.
Formula
Exponential model:
y = a · e^(b·x)
Linearise by taking ln of y:
ln(y) = ln(a) + b·x
Least-squares on (x, ln y):
b = Σ((x − x̄)(lny − lnȳ)) / Σ((x − x̄)²)
ln(a) = lnȳ − b·x̄
a = exp(ln(a))
Coefficient of determination (on ln y):
R² = 1 − SSE/SST = 1 − Σ(lny − lny_pred)² / Σ(lny − lnȳ)²
Doubling time (b > 0) and half-life (b < 0):
t_double = ln(2) / b
t_half = ln(2) / |b|
Worked Example
Example 1 — Bacteria growing exponentially:
- X = 0, 1, 2, 3, 4, 5 hours. Y = 10, 22, 49, 110, 240, 530 (cells).
- ln(Y) ≈ 2.30, 3.09, 3.89, 4.70, 5.48, 6.27 — nearly linear.
- Fit: a ≈ 10.0, b ≈ 0.794/hr, R² ≈ 0.9998.
- Doubling time: ln(2)/0.794 ≈ 0.873 hr ≈ 52 min.
- Predict at x = 6 hr: y = 10 · e^(0.794·6) ≈ 1180 cells.
Example 2 — Moore's law (1971–2020):
- X = year, Y = transistor count on flagship Intel CPU.
- 1971: 2,300 (Intel 4004). 2020: ~10¹⁰ (Ice Lake 10 nm).
- Fit: b ≈ 0.346/year (doubling every 2.0 years). R² ≈ 0.97.
- Predict at 2030: ~10¹¹ transistors — the law has held for 50 years.
Example 3 — Caffeine elimination:
- X = hours, Y = caffeine in blood (mg).
- 0 h: 200 mg; 5 h: 100 mg; 10 h: 50 mg; 15 h: 25 mg.
- Fit: a ≈ 200, b ≈ −0.139/hr (half-life 5 hr), R² = 1.0 (exact).
- Predict at 24 h: 200 · e^(−0.139·24) ≈ 9.7 mg — most caffeine gone.
Example 4 — Poor fit (linear data mis-modeled):
- X = 0, 1, 2, 3. Y = 10, 20, 30, 40 (perfectly linear, not exponential).
- ln(Y) = 2.30, 3.00, 3.40, 3.69 — not a straight line.
- Fit: a ≈ 11.16, b ≈ 0.433, R² ≈ 0.97 on ln(y) but a poor visual fit.
- Lesson: R² on ln(y) can be high even when the model is wrong — always plot.
Tips
- Linearisation via ln(y) gives a closed-form fit but introduces a small bias: you minimise squared error on ln(y), not on y. For small datasets this can shift a and b slightly. The bias-corrected estimator adds a correction term σ²/2 to the intercept ln(a) — see Wolfram MathWorld for the formula.
- Doubling time t_double = ln(2)/b for positive b. Half-life t_half = ln(2)/|b| for negative b. For b = 0.1/year, doubling time is 6.93 years — the rule of 70 (70/r% per year) approximates this as 7 years.
- R² on ln(y) ≥ 0.9 is a strong fit. R² between 0.5 and 0.9 is weak — the data is partly exponential but has other structure. R² ≤ 0.5 means try a different model: linear, polynomial, logistic, or power-law.
- If the data spans many orders of magnitude, plot on a log-y axis. If it appears as a straight line on log-y, exponential regression is appropriate. If it curves, try logistic or another saturating model.
- Moore's law example: transistor counts 1971 (Intel 4004: 2,300) to 2020 (~ 10^10) — fit gives b ≈ 0.346/year, doubling time ≈ 2 years. R² ≈ 0.97 over 50 years — a remarkable exponential fit that has held for half a century.
Common Mistakes
The most common mistake is fitting exponential regression to data with negative or zero y values — ln(y) is undefined for y ≤ 0, so the linearisation fails. This calculator checks and reports an error. A second error is over-relying on R² on ln(y): a high value does not mean the data really is exponential — linear data, for example, can have R² > 0.95 on ln(y) without being exponential. Always plot the data and the fit. A third error is using exponential regression for saturating data — if the curve flattens, switch to logistic regression instead.
Frequently Asked Questions
- What is exponential regression?
- Exponential regression fits a model y = a · e^(bx) to a set of (x, y) data points, where y must be positive. The parameter a is the initial value (y at x = 0) and b is the continuous growth rate (per unit x). For b > 0 the data is growing exponentially; for b < 0 it is decaying. The fit is done by linearising: take ln(y), then run ordinary linear regression on (x, ln(y)), giving slope b and intercept ln(a).
- How is exponential regression computed?
- Linearise by taking natural log of y: ln(y) = ln(a) + b·x. Now this is a linear equation in (x, ln(y)). Run ordinary least squares: slope b = Σ((x − x̄)(lny − lnȳ)) / Σ((x − x̄)²), intercept ln(a) = lnȳ − b·x̄. Then a = exp(intercept). The R² is computed on the linearised (ln y) data, which measures the fit quality of the linearised model — close to 1 means the data really is exponential.
- What is R² and what does it tell me?
- R² (coefficient of determination) measures the fraction of variance in y explained by the model. R² = 1 means a perfect fit; R² = 0 means the model is no better than the mean. For exponential regression, R² is computed on ln(y) against the linearised prediction ln(a) + b·x. R² ≥ 0.9 means the data is well-described by an exponential; R² ≤ 0.5 means the exponential model is poor — try linear, polynomial, or another model.
- Why must y be positive?
- Because the natural log ln(y) is only defined for y > 0. If any y value is zero or negative, the linearisation fails. In practice this means exponential regression is suitable for data that grows or decays but never crosses zero — populations, radioactive counts, concentrations, prices, infections. For data that crosses zero, use linear regression, polynomial regression, or a model with a constant offset.
- What is the difference between exponential and logistic regression?
- Exponential regression assumes unlimited growth y = a·e^(bx) with constant fractional growth rate b. Logistic regression (in the curve-fitting sense) assumes saturating growth y = K/(1 + A·e^(−rt)) that decelerates as y approaches a carrying capacity K. Early exponential data fits both, but as saturation kicks in, the exponential fit diverges from the data while the logistic stays accurate. Always plot residuals to check fit quality.
- Where is exponential regression used?
- Population biology (bacteria growth, invasive species), epidemiology (early-stage epidemic spread — COVID-19 in March 2020), finance (compound growth, inflation, asset prices), radioactive decay (fitting half-life from count data), pharmacology (drug elimination), technology adoption (Moore's law: transistor count doubling every ~2 years), and chemistry (reaction rates, first-order kinetics). Anywhere the rate of change is proportional to the current amount, exponential regression is the right tool.
Exponential regression basics
Exponential regression fits y = a · e^(bx) to data points (xᵢ, yᵢ), where a is the value at x = 0 and b is the continuous growth rate. The trick is to linearise: take ln(y) = ln(a) + b·x, which is a linear equation in x. Run ordinary least-squares on the (x, ln y) pairs, then exponentiate the intercept to recover a. The slope b is the growth rate; the doubling time is ln(2)/b; the half-life (for decay) is ln(2)/|b|.
Linearisation via ln(y)
Taking ln(y) converts exponential growth into linear growth: ln(a·e^(bx)) = ln(a) + b·x. The slope b in the linear fit is the exponential growth rate; the intercept ln(a) recovers a by exponentiating. This works because ln is the inverse of exp — applying ln undoes the exponential, revealing the linear structure. The same trick works for power-law fits: log of both sides of y = a·x^b gives ln(y) = ln(a) + b·ln(x), again a linear fit on log-log axes.
Real-world uses (growth, decay)
Exponential regression is the standard tool whenever the fractional rate of change is constant. Population biology (bacteria doubling every 20 minutes), epidemiology (cases growing exponentially early in an outbreak), finance (compound interest, inflation), chemistry (first-order kinetics, radioactive decay), pharmacology (drug elimination), Moore's law (transistor count doubling every 2 years), and technology adoption (early-stage product growth). Wherever rate ∝ current value, exponential regression is appropriate.
R² interpretation
R² (coefficient of determination) is the fraction of variance in y explained by the model. For exponential regression, R² is computed on ln(y) versus the linearised prediction. R² ≥ 0.9 means the data is well-described as exponential; R² ≤ 0.5 means the model is poor — try linear, polynomial, or logistic instead. Note that R² on ln(y) is not the same as R² on y; this calculator reports the linearised value, which is the standard for exponential fits.
| Dataset | Y range | Growth rate b | Doubling/half-life | R² |
|---|---|---|---|---|
| Moore's law (1971–2020) | ~ 2.3e3 → 1e10 | ≈ 0.346/yr | ≈ 2.0 yr | ≈ 0.97 |
| COVID-19 cases (early 2020) | exponential growth | ≈ 0.21/day | ≈ 3.3 days | ≈ 0.99 |
| Bacteria (in vitro) | 10⁵ → 10⁸ cells | ≈ 2/hr (60°C) | ≈ 0.35 hr | ≈ 0.95 |
| Caffeine elimination | 200 mg → 50 mg | ≈ −0.14/hr | t½ ≈ 5 hr | ≈ 0.99 |
| I-131 decay | 1000 → 500 Bq | −ln(2)/8.02 day | t½ = 8.02 d | 1.0 (exact) |
The linearisation trick (taking ln(y) to make exponential data linear) is one of the most useful tools in statistics. The same idea handles power laws (log-log plot), reciprocal models (1/y versus x), and square-root models (y² versus x). The recipe: pick the transformation that makes your model linear, apply it to both sides of the equation, fit ordinary least squares, and invert the transformation. The math is exact and the algorithm is fast — no iterative optimisation needed.
For data spanning many orders of magnitude (like Moore's law, which spans 7 decades from 2,300 to 10¹⁰), the linearised fit on ln(y) is actually preferred — it weights relative errors, which is the right thing when y changes by orders of magnitude. The bias correction σ̂²/2 is negligible for clean data. For small-range data with absolute-noise error structure, consider nonlinear least squares on the raw (x, y) pairs, which minimises squared error on y directly.
Exponential regression extrapolates dangerously. A model fitted to 5 years of growth data may predict 10¹⁰ in year 10, but the real system may saturate or break down. Always plot residuals and use domain knowledge to set bounds. COVID-19 case growth at b ≈ 0.21/day in March 2020 implied 10⁹⁰ cases by 2021 — obviously the model had to break down, and it did, via social distancing, immunity, and saturation. Extrapolation is for short horizons only.
Authoritative References
- Wikipedia — Exponential regression— wikipedia.orgEncyclopedic reference on exponential regression: the linearisation via ln(y), ordinary least squares on the transformed data, the bias correction (the fit on ln(y) minimises squared error on ln, not on y), and applications.
- Khan Academy — Fitting exponential models— khanacademy.orgKhan Academy's statistics units cover linearising transformations, exponential regression via ln(y), and the interpretation of fit parameters and R² with worked examples on real datasets.
- Wolfram MathWorld — Least Squares Fitting— wolfram.comEric Weisstein's reference on least-squares fitting, including the linearisation of exponential and power-law models, the normal equations, and the bias introduced by the log transformation.
Try our other free calculators
CalcGenius has 1,200+ free, ad-free, browser-based calculators for finance, health, math, science, and everyday life. No sign-up required.