Least squares
In regression analysis, least squares is a method to determine the best-fit model by minimizing the sum of the squared residuals—the differences between observed values and the values predicted by the model. Least squares problems fall into two categories: linear or ordinary least squares and nonlinear least squares, depending on whether or not the model functions are linear in all unknowns.