Ordinary least squares (OLS) estimates regression coefficients by minimizing the sum of squared residuals. Squaring prevents positive and negative errors from canceling and gives larger errors greater weight. The fitted line captures the overall relationship rather than passing through every observation. section 3.4.1
A residual is the observed response minus its predicted value; OLS minimizes the sum of squared residuals. section 3.4.1
OLS also has a probabilistic interpretation. If errors are independent, normally distributed with mean zero, and have constant variance, maximizing the likelihood of the observations gives the same coefficient estimates as minimizing squared residuals. The geometric and likelihood approaches differ in interpretation, not in their resulting regression line. section 3.4.2




