LOGARITHMIC CURVE FIT

Logarithmic Regression Calculator

Fit a logarithmic curve ŷ = a + b·ln(x) to paired X and Y observations. The predictor X must be positive. The result includes the equation, graph, R², RMSE and residuals.

Fit Y against ln(X)Positive X requiredBrowser-based

YOUR DATA

Enter paired observations

Paste or upload numeric X and Y columns. All X values must be greater than zero. Use a period as the decimal mark. Up to 5 MB and 5,000 observations are accepted.

The file is read locally in your browser.

At least two complete pairs with positive X values are needed.

How to use this calculator

  1. Paste paired X and Y values, or load the worked example.
  2. Choose the X and Y columns. Every X value must be strictly positive because ln(x) is undefined at zero and for negative numbers.
  3. Review the fitted equation, curve, R², RMSE and residuals.
  4. Download a JSON summary that records the method and any exclusions.

Formula and calculation method

The model is ŷ = a + b·ln(x). The calculator transforms each predictor to w = ln(x) and fits the straight line ŷ = a + bw by ordinary least squares. The slope b and intercept a are displayed directly in the original equation.

R² = 1 − SSE/SST and RMSE = √(SSE/n), both computed from the original-scale predictions and observed Y values.

Worked example: X = [1, e, e²] and Y = [0, 1, 2]. Then ln(X) = [0, 1, 2], so the least-squares line through these points is ŷ = 0 + 1·ln(x), giving a = 0 and b = 1.

Assumptions and limitations

Related calculators

Linear regression · Exponential regression · Quadratic regression · Compare regression models