Exponential Regression Calculator

Find the exponential growth or decay curve that fits a set of observed x and positive y values on the log scale. Compare the fitted curve and individual errors on both scales, and evaluate it at a chosen x. The worksheet handles unevenly spaced observations and shows whether a forecast is within the observed x range.

Log-linear least squares

Exponential regression explorer

Fit observed pairs, inspect errors on both scales and evaluate the curve at a new x.

Observed pairs

Enter 3–200 pairs, one x and y per line. Use a comma or whitespace between values.

Log-linear fit

Log slope per x unit

0.416586362

Multiplier per x unit

1.51677499

Log-scale RMSE

0.0497457244

Log-scale R²

0.99292077

Original-scale RMSE

0.874631123

Original-scale R²

0.995170583

ŷ = 18.5639223 × exp(0.416586362 × (x − (2)))

The reference x is the sample mean. The fit minimizes squared errors in ln(y). RMSE values use their own scale.

Forecast at x 5

64.7788476

Extrapolation beyond the observed x range. Fitted ln(y) 4.17097912.

Horizontal positions are x offsets from the sample mean.
Observed response and fitted exponential curveThe plot shows 5 observed points and the fitted model. Values are listed in the regression ledger.Observed x 0, 8Observed x 1, 13Observed x 2, 17Observed x 3, 29Observed x 4, 43Forecast at x 5, 64.7788476y · 69.321-2.163.16
  • Observed
  • Fitted
  • Forecast
Original response residuals
Observed minus fitted residual plotPositive residuals appear above the zero line. Exact entered data and numerical residuals are in the regression ledger.+1.75160−1.7516x 0, residual -0.0691432647x 1, residual 0.760925326x 2, residual -1.56392234x 3, residual 0.842706932x 4, residual 0.291722159

Regression and residual ledger

Each residual is the observed response minus its fitted response on the scale shown.

RowEntered xEntered yFitted yOriginal residualLog residual
1088.06914326-0.0691432647-0.00860577199
211312.23907470.7609253260.0603156817
321718.5639223-1.56392234-0.0880066937
432928.15729310.8427069320.0294894302
544342.70827780.2917221590.00680735381

How to use this calculator

  1. Enter one x and positive y per line in Observed pairs. Use a comma or whitespace between the two values. Repeated x values are allowed when at least two predictors differ.
  2. Read Log-linear fit to see the centered equation and per-unit multiplier. Compare log-scale and original-scale diagnostics within their respective units.
  3. Switch between Original y and Log y to compare the fitted curve and observed-minus-fitted residuals. The log view shows y relative to the first observation's scale.
  4. Enable Show prediction at an x value and enter Forecast x. The forecast indicates whether it is within the observed range or an extrapolation.
  5. Review the Regression and residual ledger. Download the regression CSV or open its selectable copy for inputs, fitted values and diagnostics.

The Formula

The mathematical logic powering this calculation is:

For positive observed yᵢ, let zᵢ = ln(yᵢ) and let x̄ and z̄ be the sample means of x and z. The log slope b = Σ[(xᵢ − x̄)(zᵢ − z̄)]/Σ(xᵢ − x̄)². The fitted response is ŷ(x) = exp[z̄ + b(x − x̄)]. Its multiplier per one-unit increase in x is exp(b). The chart uses exact decimal predictor offsets before numerical fitting and displays log responses relative to the first y.

Log residual = ln(yᵢ) − ln(ŷᵢ). Original residual = yᵢ − ŷᵢ. On each scale, RMSE = √(Σ residual²/n) and R² = 1 − Σ residual²/Σ(actual − mean)². R² is undefined when actual values are constant on that scale. Original-scale R² can be negative because the optimum is computed on log y. The two RMSEs use different units.

The output is a back-transformed log fit. The equation minimizes squared log errors and gives a geometric-center prediction. Estimating the arithmetic conditional mean under a log-error model requires a separate retransformation approach. The forecast is a model evaluation at the entered x, with the observed minimum and maximum included in the within-range classification.

Enter 3 to 200 pairs with at least two distinct x values. Predictors accept signed plain decimals through ±1 trillion with up to six decimal places. Responses accept positive plain or scientific decimals from 1e−100 to 1e100, with up to 15 significant digits. Original-scale predictions are displayed from 1e−150 to 1e150. Beyond this display range the log value remains available and the original response is marked above or below range. If any training fit is outside the display range, the original-scale fit metrics are unavailable.

Worked Example

If you input:

  • Observed pairs: (0,8), (1,13), (2,17), (3,29), (4,43)
  • Forecast x: 5

Result:

The log slope is approximately 0.41658636 and the fitted response at the mean x of 2 is approximately 18.56392. Log-scale R² is about 0.99292077 and log RMSE is about 0.04974572. Original-scale RMSE is about 0.87463112. At x = 5, the curve evaluates to about 64.77885, beyond the observed x range.

Frequently Asked Questions

How does exponential regression differ from an exponential growth projection?

Regression estimates the slope and scale from observations with different x values. A growth projection uses already specified parameters, or determines a curve through two exact anchors. This worksheet estimates a best fit for at least three observed pairs.

Why do the y values have to be positive?

This method fits a straight line to the natural logarithm of the response. The real natural logarithm requires a positive argument. Choose a model appropriate to your measurements if they include nonpositive responses.

Why can original-scale R² be negative?

On the original scale, the fitted curve can have a larger sum of squared errors than predicting the sample mean at every x. A negative original-scale R² indicates that comparison. The least-squares criterion here uses log responses.

What does the forecast represent?

It evaluates the fitted exponential curve at the requested x. Inside the observed range it is an interpolation and beyond that range it is an extrapolation. Its reliability depends on whether the same exponential pattern applies there.

Does the curve estimate the arithmetic mean of y?

The curve exponentiates the fitted log response and represents a geometric center. An arithmetic-mean prediction for a stochastic log-error model requires a retransformation method based on its error behavior.

What happens if y is constant or x values are repeated?

Constant positive y gives a flat model, zero residual error and undefined R². Repeated x values each contribute their own observation. At least two distinct x values are needed to estimate a slope.

Why is a response or multiplier marked outside display range?

Original response and multiplier values are displayed between 1e−150 and 1e150. The log-scale forecast remains available beyond those bounds. Original diagnostics require original-scale fits for every observation.

Similar Calculators