Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical & Research SuppliesReagents, PPE & instruments — chain-of-custody documented.Fast, traceable sourcing built for regulated research environments, from bench consumables to instrumentation.Shop lac.us CodeCASRAIlac.us

Exponential Regression: Formula, Fitting and Code

A guide to exponential regression: log-linearization versus nonlinear fitting, model assumptions, worked arithmetic, and Excel, R, and Python code recipes.

Written and maintained by CASRAI Editorial Board

Last updated

Definition of Exponential Regression

Exponential regression is a nonlinear modeling method used to quantify relationships where a response variable changes at a rate proportional to its current magnitude. Common across pharmacology, kinetics, ecology, and finance, exponential regression models continuous growth or decay processes governed by the differential relationship dy/dx = b × y. Unlike ordinary linear regression, which assumes constant additive increments, an exponential regression curve assumes that equal increments in the predictor variable produce constant percentage or multiplicative changes in the dependent variable.

Exponential Regression Formula and Models

In quantitative analysis, the standard exponential regression formula is expressed in two mathematically equivalent functional forms:

  • Natural exponential form: y = a × e^(b × x)
  • General base form: y = a × c^x (where c = e^b)

Every mathematical symbol in the exponential regression equation represents a distinct structural property of the fitted curve:

  • y: The continuous response variable. For log-transformed models, y must be strictly positive (y > 0).
  • x: The independent predictor variable (such as elapsed time, substrate concentration, or treatment cycle).
  • a: The baseline scale parameter. Because e^(b × 0) = 1, parameter a represents the y-intercept at x = 0.
  • b: The continuous rate constant. When b > 0, the curve exhibits exponential growth; when b < 0, it models exponential decay toward zero.
  • e: Euler’s number, the mathematical constant base of the natural logarithm (approximately 2.71828).

When physical systems level off at a non-zero baseline, researchers apply a three-parameter asymptotic model: y = a + b × e^(c × x), where a denotes the horizontal asymptote, b is the dynamic range, and c governs transition rate.

Log-Linearization vs. Nonlinear Least Squares Fitting

Fitting an exponential regression model requires choosing between log-linear transformation and direct nonlinear least squares (NLS):

  • Log-Linear OLS (Multiplicative Error): Taking the natural logarithm yields ln(y) = ln(a) + b × x + ε. Setting β₀ = ln(a) and β₁ = b allows estimation via ordinary least squares. In Python, data is transformed using numpy log. This model assumes multiplicative noise, y = a × e^(b × x) × exp(ε), minimizing relative squared errors ∑ [ln(yᵢ) – ln(ŷᵢ)]².
  • Nonlinear Least Squares (Additive Error): As documented in NIST e-Handbook Section 4.1.4.2, NLS estimates parameters by minimizing raw squared residuals, ∑ [yᵢ – a × e^(b × xᵢ)]², assuming additive error y = a × e^(b × x) + ε. Iterative algorithms optimize parameters from initial guesses. Researchers implement this in Python using curve fit in SciPy.
  • Back-Transformation Bias (Jensen’s Inequality): Directly exponentiating log-scale predictions (ŷ = exp(β₀ + β₁ × x)) produces the median rather than the conditional mean. Under log-normal residual variance σ², the unbiased mean forecast requires the Finney-Neyman correction factor: ŷ_mean = exp(β₀ + β₁ × x) × exp(σ² / 2).

Worked Example with Real Numbers

Consider five experimental observations measuring cell density (y in units × 10³) across incubation hours (x): (1, 4.2), (2, 8.5), (3, 19.1), (4, 41.0), and (5, 92.4).

1. Log-Transformation of Response Values

  • x₁ = 1, ln(y₁) = ln(4.2) = 1.4351
  • x₂ = 2, ln(y₂) = ln(8.5) = 2.1401
  • x₃ = 3, ln(y₃) = ln(19.1) = 2.9497
  • x₄ = 4, ln(y₄) = ln(41.0) = 3.7136
  • x₅ = 5, ln(y₅) = ln(92.4) = 4.5261

2. Intermediate Summary Arithmetic

  • ∑ x = 15.0 (Mean x̄ = 3.0)
  • ∑ ln(y) = 14.7646 (Mean ln(y)̄ = 2.9529)
  • ∑ x² = 1 + 4 + 9 + 16 + 25 = 55.0
  • ∑ (x × ln(y)) = 1(1.4351) + 2(2.1401) + 3(2.9497) + 4(3.7136) + 5(4.5261) = 52.0493

3. Parameter Calculation

  • SSxx = ∑ x² – (∑ x)² / n = 55.0 – (15.0)² / 5 = 10.0
  • SSxy = ∑ (x × ln(y)) – (∑ x × ∑ ln(y)) / n = 52.0493 – (15.0 × 14.7646) / 5 = 7.7555
  • Slope b = SSxy / SSxx = 7.7555 / 10.0 = 0.7756
  • Intercept β₀ = ln(y)̄ – (b × x̄) = 2.9529 – (0.7756 × 3.0) = 0.6261
  • Baseline a = exp(β₀) = exp(0.6261) = 1.8703

The fitted log-linear exponential regression model is ŷ = 1.8703 × e^(0.7756 × x).

By comparison, direct NLS numerical optimization on raw data yields a = 1.7086 (SE = 0.0656) and b = 0.7978 (SE = 0.0080). NLS achieves lower raw sum of squared errors (0.814 vs. 1.442) because it prioritizes absolute error minimization at large values of y.

Interpretation and Goodness-of-Fit

Interpreting exponential regression requires analyzing rate parameters alongside fit diagnostics.

Reading Model Coefficients

  • Percentage Rate of Change: Percentage increase in y per unit x is (e^b – 1) × 100%. With b = 0.7756, the response grows by (e^0.7756 – 1) × 100% = 117.19% per hour.
  • Doubling Time: For growth models (b > 0), doubling time is t_double = ln(2) / b = 0.69315 / 0.7756 = 0.894 hours (53.6 minutes).
  • Half-Life: For decay models (b < 0), half-life is t_half = ln(2) / |b|.

Goodness-of-Fit Guidance

Metric Formula Interpretation Guidance
Log-Scale R² 1 – (SSres_log / SStot_log) Measures variance explained in ln(y). Useful for log-linear screening, but does not measure raw-scale variance.
Pseudo-R² (Raw) 1 – [∑(yᵢ – ŷᵢ)² / ∑(yᵢ – ȳ)²] Measures variance explained on original scale. Useful when comparing against models like quadratic regression analysis.
Residual Standard Error (RSE) √[SSres / (n – p)] Standard deviation of residuals in original response units. Lower values indicate superior fit precision.
AIC / BIC -2 ln(L) + 2k Penalized likelihood criteria for model selection among non-nested competitors. Lower values indicate better fit.

Assumptions and Common Mistakes

Valid statistical inference relies on several core assumptions:

Core Assumptions

  1. Strictly Positive Values: Log-linearized models require y > 0 for all records. Zeros cannot be transformed directly.
  2. Appropriate Error Structure: Determine whether noise is multiplicative (variance scales with y) or additive (constant absolute variance).
  3. Residual Independence: Observations must be independent. Autocorrelation in kinetic series requires mixed-effects modeling.

Common Mistakes

  • Equating Log-Scale R² with Raw Fit: High R² on ln(y) often obscures substantial absolute prediction errors at large response values.
  • Ignoring Jensen’s Inequality: Using uncorrected back-transformed estimates underestimates the population conditional mean.
  • Unwarranted Extrapolation: Exponential projections diverge rapidly outside observed experimental bounds.

How to Report Exponential Regression in APA Style

APA 7th edition formatting requires reporting parameter estimates, standard errors, confidence intervals, sample size, degrees of freedom, and fit metrics.

Example Reporting Text:

A nonlinear least squares exponential growth model was fitted to evaluate cell concentration as a function of incubation time using the model y = a × e^(b × x). The baseline scale parameter was statistically significant, a = 1.71, SE = 0.07, 95% CI [1.50, 1.92], and the instantaneous growth rate parameter was b = 0.80, SE = 0.01, 95% CI [0.77, 0.82], p < .001. The model accounted for 99.8% of the variance in raw cell concentration (pseudo-R² = .998, RSE = 0.52, df = 3). The estimated doubling time was 0.87 hours, confirming rapid exponential expansion across the experimental observation window.

How to Calculate Exponential Regression in Excel, R, and Python

Researchers can implement exponential regression across standard analytical toolchains using the following verified recipes.

1. How to Do Exponential Regression in Excel

  • LOGEST: Highlight an empty 2×2 range and enter =LOGEST(B2:B6, A2:A6, TRUE, TRUE) as an array formula. Cell (1,1) outputs base multiplier c = e^b, and cell (1,2) outputs scale a.
  • GROWTH: Calculate predicted exponential values directly with =GROWTH(B2:B6, A2:A6, A7).
  • Chart Trendline: For visual regression lines, consult how to add trendline in Excel, select Exponential, and display the equation on the chart.

2. Exponential Regression in R

df = data.frame(
  x = c(1, 2, 3, 4, 5),
  y = c(4.2, 8.5, 19.1, 41.0, 92.4)
)

# Method 1: Log-linear OLS
fit_log = lm(log(y) ~ x, data = df)
a_ols = exp(coef(fit_log)[1])
b_ols = coef(fit_log)[2]

# Method 2: Direct Nonlinear Least Squares
fit_nls = nls(y ~ a * exp(b * x), data = df, start = list(a = 2, b = 0.7))
summary(fit_nls)

3. Exponential Regression in Python

import numpy as np
from scipy.optimize import curve_fit

x = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
y = np.array([4.2, 8.5, 19.1, 41.0, 92.4])

def exp_func(t, a, b):
    return a * np.exp(b * t)

popt, pcov = curve_fit(exp_func, x, y, p0=[2.0, 0.7])
a_hat, b_hat = popt
se_params = np.sqrt(np.diag(pcov))

print(f"y = {a_hat:.4f} * exp({b_hat:.4f} * x)")
print(f"SE(a): {se_params[0]:.4f}, SE(b): {se_params[1]:.4f}")

For advanced diagnostic testing and generalized regression workflows in Python, consult our guide to the statsmodels API.

Frequently Asked Questions

When should I choose exponential regression over quadratic regression?

Select exponential regression when physical theory specifies proportional change (e.g., cell replication, compound growth, drug clearance). Choose quadratic regression when the underlying relationship changes direction, creating a parabolic curve. Compare AIC or BIC to verify model selection empirically.

How does Desmos calculate exponential regression?

In Desmos, fitting y1 ~ a * b^(x1) uses log-mode by default, which transforms the data using natural logarithms and performs linear regression. Disabling log-mode causes Desmos to use numerical optimization to minimize squared residuals on the original scale.

How do I handle zero or negative response values?

Log-linearization is impossible for y ≤ 0 because ln(y) is undefined. In research settings, researchers either fit a direct nonlinear least squares model with an additive offset, y = a + b × e^(c × x), or implement a Generalized Linear Model (GLM) with a log link and Poisson or negative binomial variance.

Why do Excel and R report different exponential regression coefficients?

Excel’s LOGEST and trendline tools fit a log-linearized model that minimizes relative percentage errors. In contrast, R’s nls() function minimizes absolute squared errors on the raw response variable. Both are mathematically sound, but they optimize different loss functions.

Sources

  • Bates, D. M., & Watts, D. G. (1988). Nonlinear Regression Analysis and Its Applications. John Wiley & Sons.
  • Montgomery, D. C., Peck, E. A., & Vining, G. G. (2021). Introduction to Linear Regression Analysis (6th ed.). John Wiley & Sons.
  • NIST/SEMATECH. (2012). e-Handbook of Statistical Methods. Section 4.1.4.2: Nonlinear Least Squares Regression. National Institute of Standards and Technology. https://www.itl.nist.gov/div898/handbook/pmd/section1/pmd142.htm
  • R Core Team. (2026). R: A Language and Environment for Statistical Computing. Function documentation: stats::nls. https://stat.ethz.ch/R-manual/R-patched/library/stats/html/nls.html
  • SciPy Community. (2026). scipy.optimize.curve_fit Reference Documentation. https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html
  • Microsoft Support. (2026). LOGEST Function (Microsoft Excel Documentation). https://support.microsoft.com/en-us/office/logest-function-f27462d8-3657-4fa0-36e4-aa21805a91f6

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Exponential Regression: Formula, Fitting and Code

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →