Curve Fitting Calculator

Choose a curve type and enter the x and y values of your points.

Numbers separated by commas.

The same number of numbers as the x values.

Try

Result

You entered3 points\text{3 points}

y=2+0.868589ln⁡x\displaystyle y = 2 + 0.868589\ln x

R²

R2≈1\displaystyle R^2 \approx 1
Show the work
  1. Least-squares logarithmic fit

    The model y=a+bln⁡xy = a + b \ln x is a straight line in ln⁡x\ln x and yy, so a least-squares line through those values gives aa and bb.

  2. Slope and intercept of the straight line

    Here uu is ln⁡x\ln x and ww is yy; the line is w=c+buw = c + b u through the point of means.

    Using b=∑(u−uˉ)(w−wˉ)∑(u−uˉ)2b = \dfrac{\sum (u - \bar{u})(w - \bar{w})}{\sum (u - \bar{u})^2}

    b=0.868589, c=2, a=c=2b = 0.868589,\ c = 2,\ a = c = 2
  3. Coefficient of determination

    R2R^2 compares the squared gaps between the actual yy values and the curve with the spread of yy about its mean; 11 means a perfect fit.

    Using R2=1−SSresSStotR^2 = 1 - \dfrac{SS_{res}}{SS_{tot}}

    R2≈1R^2 \approx 1
  4. Result

    The best logarithmic fit is y=2+0.868589ln⁡xy = 2 + 0.868589\ln x.

Worked examples