The linear model
You observe pairs and model them as , where the are noise. Stack the rows and it becomes
where is an -vector, is the design matrix (first column all ones for the intercept, one column per predictor) and holds the coefficients. Least squares picks the that minimizes the sum of squared residuals , where is row of . Squares make the problem smooth with a closed-form answer, and when the noise is normal the same comes out of maximum likelihood, as the Maximum Likelihood lesson shows.
Take five points: , . The design matrix has rows . The useful move is to stop picturing five points in the plane and treat as a single vector in . Every choice of produces a vector , and the set of all of them is the column space of , a 2-dimensional plane sitting inside 5-dimensional space. No line passes through all five points, so lies off that plane, and finding the best line becomes a geometry question: which point on the plane is closest to ?