1.672129
4.280985
0.995935
0.294377
1.672129
1.672129
4.280985
0.995935
0.294377
1.672129
The Logarithmic Regression Calculator fits the model y = a + b·ln(x) to your data, capturing relationships where Y increases (or decreases) rapidly at first and then progressively levels off. This diminishing returns pattern appears throughout science and everyday life: the perceived loudness of sound (Weber-Fechner law), learning curves, response to increasing doses of medication, ecological species-area relationships, and the marginal utility of income in economics.
The calculator transforms X values using the natural logarithm, then applies standard linear regression on (ln(x), y) to determine the coefficients. All X values must be positive since ln(x) is undefined for x ≤ 0. Enter up to 5 data pairs to find the best-fit logarithmic curve.
The logarithmic regression model is:
$$y = a + b \ln(x)$$
This is already linear in the transformed variable \(X' = \ln(x)\). Substituting, we get \(y = a + bX'\), which is a standard linear regression problem. The ordinary least squares formulas apply directly:
$$b = \frac{n\sum \ln(x_i) \cdot y_i - \sum \ln(x_i) \cdot \sum y_i}{n\sum [\ln(x_i)]^2 - [\sum \ln(x_i)]^2}$$
$$a = \bar{y} - b \cdot \overline{\ln(x)}$$
The coefficient b determines the rate at which Y changes with the logarithm of X. When b > 0, Y increases as X increases, but at a decreasing rate (the classic diminishing returns curve). When b < 0, Y decreases as X increases, but the rate of decrease slows down. The rate of change at any point is dy/dx = b/x, which decreases as x grows.
The coefficient a is the Y value when ln(x) = 0, i.e., when x = 1. This serves as a meaningful reference point in many applications. The R² is computed on the original scale to reflect how well the logarithmic model fits the untransformed data.
Interpreting logarithmic regression results:
Logarithmic regression is appropriate when the marginal effect of X decreases as X grows. It is not appropriate when Y grows without bound at an increasing rate (use exponential) or when Y eventually levels off at a fixed ceiling (use logistic). The model is undefined at X = 0 and predicts negative Y for sufficiently small X values (if b > 0), which may be unrealistic in some applications.
Inputs
Results
Test scores vs. study hours show diminishing returns: the first hour raises the score dramatically, but each subsequent hour adds less. The model y = 39.5 + 16.9·ln(x) predicts that doubling study time adds 16.9·ln(2) ≈ 11.7 points regardless of the starting point. R² = 0.998.
Inputs
Results
Species richness on islands follows a classic log pattern. The model y = 10.3 + 9.5·ln(area) captures the species-area relationship. Each 10-fold increase in area adds about 9.5·ln(10) ≈ 21.9 species. R² = 0.999 confirms an excellent logarithmic fit.
The logarithmic model uses ln(x), and the natural logarithm is only defined for positive numbers. ln(0) = -∞ and ln(negative) is undefined in real numbers. If your X values include zero or negatives, consider shifting the data (e.g., use x + 1 as the predictor) or using a different regression model such as linear or polynomial that does not require a log transformation.
The coefficient b tells you how much Y changes when X is multiplied by a factor. Specifically, when X doubles, Y changes by b·ln(2) ≈ 0.693b. When X increases tenfold, Y changes by b·ln(10) ≈ 2.303b. This multiplicative interpretation is natural for many phenomena: perceived loudness doubles when sound intensity increases by a fixed ratio (Weber-Fechner law), income satisfaction increases logarithmically with salary, and so on.
They model opposite patterns. Exponential regression (y = a·e^(bx)) models quantities that grow or decay at an accelerating rate — the X-axis is linear and Y changes exponentially. Logarithmic regression (y = a + b·ln(x)) models quantities that change rapidly at first then level off — Y is linear and X is on a log scale. Mathematically, if you swap the roles of X and Y in exponential growth, you get a logarithmic curve.
No. The logarithmic function ln(x) increases without bound as x → ∞, so the model y = a + b·ln(x) has no upper asymptote. It just grows more and more slowly. If your data has a natural ceiling (e.g., a test score capped at 100), a logistic regression or saturation model is more appropriate. However, within the observed data range, logarithmic regression often provides an excellent practical approximation of diminishing returns behavior.
Not exactly. Logarithmic regression (this calculator) transforms the predictor: y = a + b·ln(x). Log-linear regression transforms the response: ln(y) = a + bx, which is equivalent to exponential regression y = e^(a+bx). Log-log regression transforms both: ln(y) = a + b·ln(x), which is power regression y = e^a · x^b. Each serves different purposes depending on which variable exhibits the nonlinear behavior.
Plot Y against ln(X) — if the resulting scatter plot appears roughly linear, logarithmic regression is appropriate. Alternatively, plot Y vs X directly: if the curve rises steeply at first then flattens, it suggests a log pattern. Compare R² values from linear, logarithmic, exponential, and power regressions to see which model fits best. Also check that residuals from the logarithmic fit are randomly scattered with no systematic pattern.
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!
Linear Regression Calculator
Regression & Correlation Analysis
Simple Linear Regression Calculator
Regression & Correlation Analysis
Multiple Regression Calculator
Regression & Correlation Analysis
Polynomial Regression Calculator
Regression & Correlation Analysis
Exponential Regression Calculator
Regression & Correlation Analysis
Power Regression Calculator
Regression & Correlation Analysis