Least-Squares Line

Pronunciation: /list skwɛɚz laɪn/ Explain

A least-square line is a line that minimizes the distance between the data points it represents and the line itself. Manipulative 1 is an example of a least squares line fitted to data.

Click on the blue points and drag them to change the figure.

Move the points to create a near-vertical line. Move the points to create a near-horizontal line.
Manipulative 1 - Least Squares Line Created with GeoGebra.

How to Calculate a Least Squares Line

In the equations, N is the number of points. x is the x-coordinate of a point. y is the y-coordinate of a point. All calculated amounts are approximate.


m=(n*sum(xy)-sum(x)*sum(y))/(n*sum(x squared)-(sum(x) squared)) = (6*31.18-12.4*14.1)/(5*35.28)-12.4 squared)=(187.08-174.84)/(176.4-153.76)=12.24/22.64=0.54
y=mx + b implies y=0.54x + 1.234

Cite this article as:

McAdams, David E. Least-Squares Line. 8/31/2018. All Math Words Encyclopedia. Life is a Story Problem LLC. http://www.allmathwords.org/en/l/leastsquareline.html.

Image Credits

Revision History

8/31/2018: Removed broken links, updated license, implemented new markup, implemented new Geogebra protocol. (McAdams, David E.)
7/18/2018: Changed title to common format. (McAdams, David E.)
7/12/2007: Initial version. (McAdams, David E.)

All Math Words Encyclopedia is a service of Life is a Story Problem LLC.
Copyright © 2018 Life is a Story Problem LLC. All rights reserved.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License