TOPICS
Search

Line of Best Fit


A line of best fit is a line chosen to summarize the relationship between two numerical variables. Under the ordinary least squares criterion, the fitted line y=a+bx minimizes the residual sum of squares

 sum_(i=1)^n(y_i-a-bx_i)^2.
(1)

When the x_i are not all equal, the minimizing coefficients are

b=(sum_(i)(x_i-x^_)(y_i-y^_))/(sum_(i)(x_i-x^_)^2),
(2)
a=y^_-bx^_.
(3)

Other definitions of best fit arise from different loss functions or assumptions about residuals in both coordinates.


See also

Least Squares Fitting, Linear Regression, Residual

Explore with Wolfram|Alpha

References

Weisberg, S. Applied Linear Regression, 3rd ed. Hoboken, NJ: Wiley, 2005.

Cite this as:

Weisstein, Eric W. "Line of Best Fit." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/LineofBestFit.html

Subject classifications