*(this article needs work, more content, explanation of the Gauss method)*

**Least squares** is a mathematical optimization technique that attempts to find a "best fit" to a set of data by attempting to minimize the sum of the squares of the errors between the fitted function and the data.

It is commonly used in curve fitting. Many other optimization problems can also be expressed in a least squares form, either minimizing energy or maximizing entropy.

See linear regression and Gauss-Markov theorem. The Gauss-Markov theorem says that least-squares estimators are in a certain sense optimal.