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
R²
0.9991
Correlation r
0.9995
Data points
6
Scatter plot and fitted curve
Data points and predictions
| x | Observed y | Predicted y |
|---|---|---|
| 1 | 2.1 | 2.1673 |
| 2 | 3.5 | 3.4334 |
| 3 | 4.2 | 4.174 |
| 5 | 5.1 | 5.1071 |
| 8 | 6 | 5.9656 |
| 13 | 6.8 | 6.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
- Home
Logarithmic Regression Calculator