keisoku

Logarithmic Regression Calculator

Fit a logarithmic model y = a + b ln(x) to your (x, y) data using least squares. See the coefficients a and b, the coefficient of determination R², a scatter plot with the fitted curve, and a table of predicted values.

Input

Enter your (x, y) data points to fit the logarithmic model y = a + b ln(x) by least squares. Only positive x values are supported.

One point per line, with x and y separated by a comma or a space. At least 3 points are required.

Result

Regression equation

y = 2.1673 + 1.8266 ln(x)

Intercept a

2.167285

Coefficient b

1.826627

0.9991

Correlation r

0.9995

Data points

6


Scatter plot and fitted curve

1136.85252.1x = 1, y = 2.1x = 2, y = 3.5x = 3, y = 4.2x = 5, y = 5.1x = 8, y = 6x = 13, y = 6.8

Data points and predictions

xObserved yPredicted y
12.12.1673
23.53.4334
34.24.174
55.15.1071
865.9656
136.86.8525

How it works

  • The model is y = a + b ln(x), defined only for positive x. Substituting u = ln(x) turns it into the simple linear regression y = a + b u, so least squares gives a and b directly.
  • The slope is b = Sum of (u − mean u)(y − mean y) divided by Sum of (u − mean u) squared, and the intercept is a = mean y − b times mean u, where mean u and mean y are the averages of u and y.
  • The coefficient of determination R² equals 1 minus the residual sum of squares divided by the total sum of squares. Values closer to 1 indicate a better fit. The correlation r is the Pearson correlation between u and y, and R² equals r squared.
  • Enter one point per line with x and y separated by a comma or a space. At least 3 points are required. Points where x is 0 or less, or data where every x is identical, cannot be fitted.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Logarithmic Regression Calculator