Goal of small residuals

A linear model's residuals are vertical distances from the scatterplot's crosses to the line and indicate how closely predictions from the line (the fitted values) match the actual responses in the data.

Positioning the line to give small residuals therefore results in a good model. This means choosing the model parameters b0 and b1 to make the residuals as small as possible.

Least squares

An objective way to get small residuals is to choose b0 and b1 to minimise the residual sum of squares

The resulting values of b0 and b1 are called their least squares estimates and the method is called the method of least squares.

The problem of minimising the residual sum of squares is not difficult mathematically, but you will rarely require or use the resulting formulae for b0 and b1 since spreadsheets, statistical programs and even scientific calculators will do the calculations for you. However, for completeness, the formulae are