How the fit works
Take ln(y) for each data point, then run linear regression of ln(y) against x. The slope is b; the intercept is ln(a). Back-transform with a = e^intercept. The residuals are minimised in log-space, which is the standard linearisation for exponential models. Once a and b are known, they feed directly into the exponential function calculator if the fitted curve needs to be evaluated at additional x values.
Interpreting R²
R² close to 1 indicates the exponential model captures almost all variation. Values below 0.7 suggest the relationship is not exponential. Try a polynomial, logistic or power fit instead.
When linearisation distorts
Log-space least squares minimises relative error rather than absolute error. For datasets with large dynamic range this is usually what you want; for datasets dominated by a few large values, a nonlinear least-squares fit on the original scale may be preferred.
Worked example using the sample dataset
The seven points loaded by default climb from 100 to 320 over six periods, the kind of pattern you might see in weekly app signups or a small population census. Running the log-linear fit on that data returns a ≈ 99.82, b ≈ 0.1934, and R² ≈ 0.999, a near-perfect fit. Converting b to a per-period growth rate with e^b − 1 gives about 21.3% growth each period, and dividing ln(2) by b gives a doubling time near 3.6 periods. Anyone tracking a similar series can plug the same growth rate into the growth rate calculator to check the conversion, or into the doubling time calculator to see how many periods a value takes to double.
Choosing between exponential, logistic and linear fits
Not every rising curve is exponential. If growth is unrestricted and the percentage increase per period stays roughly constant, exponential regression is the right tool. If growth slows and flattens as it approaches some ceiling, a logistic growth model with a carrying capacity fits better. If the data increases by a fixed amount per period rather than a fixed percentage, ordinary linear regression is the correct choice, and forcing an exponential curve onto it will show a high R² only because the sampled x range is narrow.
How many data points do you need
Two points determine a line exactly, so two points also determine an exponential fit exactly, but with zero information about whether the curve actually describes the process. Five to seven points, spread across the full range that matters, give a far more trustworthy R² and let outliers show up clearly in the residuals. When possible, space the x values roughly evenly rather than clustering them at one end, since a fit built mostly from early, low-value points can extrapolate badly at the high end where an exponential curve grows fastest. The default seven-point dataset loaded above follows this pattern deliberately.
Common mistakes
A handful of errors show up again and again. Fitting a curve that is forced through the origin instead of allowing a genuine intercept assumes the process starts at zero, which is rarely true for real data. Trusting a high R² without inspecting the residual plot can hide a fit that curves the wrong way at the edges of the range. Using only three or four points makes the slope estimate unstable and the R² close to meaningless. Extrapolating far beyond the observed x range is the riskiest habit: a curve that fits seven data points beautifully can be wildly wrong ten periods later once real-world limits like resource constraints or market saturation take hold.
FAQ
What is exponential regression?
Exponential regression fits a curve of the form y = a × e^(bx) to a set of data points, finding the constants a and b that minimize the error between the curve and the observed values. It is the standard tool for analyzing data that grows or decays at a constant percentage rate, such as population counts, radioactive decay, or early-stage epidemic case counts.
How is exponential regression done?
Take the natural logarithm of each y value, then run an ordinary linear regression of ln(y) against x. The slope of that line equals b, and the intercept equals ln(a), so a = e^intercept. Applied to the seven-point sample dataset preloaded above, this method returns a ≈ 99.82, b ≈ 0.1934, and R² ≈ 0.999, a near-perfect exponential fit.
What does R² mean?
R² measures the share of variance in the data that the exponential curve explains, on a scale from 0 to 1. R² = 0.95 means the model accounts for 95% of the variation in y. Values above 0.90 indicate a strong fit; below 0.70, the data probably is not exponential and a different model should be tried.
When does exponential regression fail?
It fails whenever the underlying process is not actually exponential, including bell-shaped curves, S-shaped logistic curves, and simple polynomial trends. A high R² on log-transformed data can still hide a poor fit if the residuals show a clear pattern rather than random scatter. Always plot the raw data and the residuals before trusting any exponential fit.
Can y values be zero or negative?
No, because ln(y) is undefined for y less than or equal to zero, and the log-linear method used here simply drops those points. If a dataset includes zero or negative values, add a constant offset large enough to make every value positive, or switch to a nonlinear least-squares fit performed directly on the original scale.
What are real-world uses?
Exponential regression shows up across population biology, epidemiology for early-phase case counts, pharmacokinetics for drug clearance rates, finance for compounding returns, physics for radioactive decay, and chemistry for first-order reaction kinetics. Anywhere a quantity changes by a roughly constant percentage per unit of time, this same y = a × e^(bx) model applies.