Exponential Regression Calculator
Paste or type your (x, y) data pairs to fit the exponential model y = a * b^x by least-squares regression. The calculator returns the coefficients a and b, the coefficient of determination R-squared, the natural growth or decay rate, the doubling time or half-life, and a predicted y value for any x you choose. Results and the step-by-step derivation update instantly as you type.
Formula
Worked example
For data points (0, 2.5), (10, 3.0), (20, 3.7), (30, 4.4), (40, 4.9), (50, 5.7), (60, 6.5), (70, 7.8): ln-transform the y values, run OLS on (x, ln y) to get k and ln(a), then recover a = e^{ln(a)} and b = e^k. The result is approximately y = 2.42 * 1.0154^x with R-squared near 0.99, giving a doubling time of about 45 x-units.
What is exponential regression?
Exponential regression fits a curve of the form y = a * b^x to a set of (x, y) data points, where a is the initial value of y when x equals zero, and b is the multiplicative growth factor per unit increase in x. When b is greater than 1, y grows exponentially; when b is between 0 and 1, y decays. This model is widely used to describe population growth, radioactive decay, compound interest without compounding periods, bacterial colony counts, and any process where the rate of change is proportional to the current value. The key requirement is that all y values must be strictly positive, because the fitting method relies on taking natural logarithms.
How the fitting method works
Direct least-squares minimisation on the non-linear curve is computationally intensive, so the standard approach is to log-linearise the model. Taking the natural logarithm of both sides of y = a * b^x gives ln(y) = ln(a) + x * ln(b), which has the form of a straight line with intercept ln(a) and slope k = ln(b). Ordinary least squares (OLS) is then applied to the pairs (x, ln(y)) to estimate the slope k and intercept ln(a) from the standard OLS formulas. Exponentiating recovers a = e^{ln(a)} and b = e^k. R-squared is computed on the original y scale (not the log scale) so it reflects how well the curve fits the raw data.
Doubling time and half-life
When the model is written as y = a * e^(kx), the time for y to double (k > 0) or halve (k < 0) follows from setting the ratio to 2: solving a * e^(k * (x + T)) / (a * e^(kx)) = 2 gives e^(kT) = 2, so T = ln(2) / |k|. This is the same formula used in finance (Rule of 72 is an approximation of it), biology (bacterial doubling time), and nuclear physics (radioactive half-life). Because the formula depends only on the growth rate k and not on the starting value a, it is a compact single-number summary of how fast the process advances.
Exponential vs. power vs. logarithmic regression
Exponential regression (y = a * b^x) and power regression (y = a * x^b) look similar but behave very differently. In exponential regression the exponent is the independent variable x, so growth accelerates without bound. In power regression the base is x, giving curves that flatten for large x when b is less than 1. A quick diagnostic is to plot ln(y) against x for exponential (should be linear) and ln(y) against ln(x) for power (should be linear). Logarithmic regression (y = a + b * ln(x)) is appropriate when the response grows quickly at first and then flattens, which is the opposite shape of exponential growth. If you are uncertain which model fits your data best, compare R-squared values across models and inspect residual plots.
R-squared interpretation guide
| R-squared range | Fit quality | What it means |
|---|---|---|
| 0.95 - 1.00 | Excellent | Model explains nearly all variation in y |
| 0.80 - 0.94 | Good | Strong fit; minor unexplained variation |
| 0.60 - 0.79 | Moderate | Reasonable fit; consider checking for outliers |
| 0.40 - 0.59 | Weak | Large residuals; model may not be appropriate |
| Below 0.40 | Poor | Exponential model is likely a poor choice for this data |
Common benchmarks for interpreting the coefficient of determination in regression models. Context matters: a higher threshold may be expected in controlled lab settings.
Frequently asked questions
Why must all y values be positive?
The fitting method log-linearises y = a * b^x by taking ln(y). The natural logarithm is only defined for strictly positive numbers: ln(0) is negative infinity and ln(y) does not exist for y < 0. If your data includes zeros or negative y values, exponential regression in this form cannot be applied. You may need to shift the data upward by a constant, or consider a different model such as logistic or polynomial regression.
What does b greater than 1 versus b between 0 and 1 mean?
When b > 1, every unit increase in x multiplies y by a factor greater than 1, so y grows exponentially. For example, b = 1.05 means y increases by 5% for each unit of x. When 0 < b < 1, every unit increase in x multiplies y by a fraction, so y decays toward zero. For example, b = 0.90 means y decreases by 10% per unit of x.
How do I interpret R-squared in exponential regression?
R-squared (the coefficient of determination) measures what fraction of the total variance in the original y values is explained by the fitted curve. A value near 1 means the exponential model tracks the data closely; a value near 0 means it does not. Note that R-squared here is computed on the original scale, not the log scale, so it directly answers "how well does the curve y = a * b^x fit my data?"
How many data points do I need?
You need at least 2 distinct x values to estimate the two parameters a and b. In practice, fewer than 5 or 6 points often produces an unstable fit that is highly sensitive to individual observations. For reliable inference, aim for at least 10 to 20 points that span the full range of x values you care about.
How do I predict y for a new x value?
Once the coefficients a and b are estimated, substitute any x into the formula: y = a * b^x. This is extrapolation if x lies outside the range of your training data. Use extrapolated predictions cautiously, because exponential curves can rise or fall very steeply, and a small error in b is magnified for large x.
What is the difference between y = a * b^x and y = a * e^(kx)?
They are the same model expressed differently. Setting k = ln(b) means b^x = e^(k * x), so y = a * b^x = a * e^(kx). The base-b form is common in population and finance contexts where b has a direct percentage interpretation (b = 1.05 means 5% growth per period). The natural-exponential form is preferred in physics, biology, and differential equations because k is the continuous growth rate, and the doubling/half-life formula T = ln(2)/|k| follows directly.