When data points don't lie exactly on a line, the normal equation finds the best-fit line by projecting the data vector onto the column space of the design matrix.
Loading…
Overdetermined systems and the least squares solution
State that more equations than unknowns generally leaves without an exact solution, and record that multiplying through by yields an minimizing the sum of squared errors.
The design matrix for the line
Build with a column of ones and a column of the values, with the unknown coefficients and stacked in .
Worked fit to , ,
Write the three equations , , in matrix form, form and , and solve for and .