Let be an table with columns , let be the list of readings, and let be the list of coefficients. The cost is (a) Expand as . (b) Use the perpendicularity condition of section 8.2, that at the best the residual is perpendicular to every column of , to derive . (c) Show without calculus that every solution of that system minimises , by proving that for any solution (d) Take , so is one column , and show that the solution is , the multiplier of section 8.2, so that the fitted values are the shadow of on the line through . (e) Apply the one-column result to and and give .
This tier asks for a derivation, so there is no automatic checker. Write your answer, then open the worked solution and compare.
Worked solution
(a) Write the residual list as . Then The middle term is , because moving to the other side of a dot product transposes it. The last term is . So (b) Section 8.2 proves that the closest point of a subspace is the one whose error is perpendicular to the subspace. The fitted list lies in the subspace spanned by the columns of , and the error is . The error is perpendicular to that subspace exactly when it is perpendicular to each column. The -th such dot product is the -th entry of , so the condition is This is one equation per coefficient, which is why the system is square.
(c) Let solve the system, so . For any , Take the squared length of both sides. The cross term is because solves the system. Therefore A squared length is never negative, so , and equality holds exactly when . Every solution of the normal equations is a minimiser, and two different solutions give the same fitted list ; that is the statement of section 8.5 that dependent columns leave the coefficients undetermined but not the fit.
(d) With one column, is and is a single number. The matrix is the matrix whose entry is , and is the number . The normal equation is therefore , so which is exactly the multiplier in the projection formula of section 8.2. The fitted values are , the shadow of on the line through .
(e) For and , the dot products are and , so . The fitted values are , and the residual is . Its dot product with the column is , which checks the perpendicularity condition, and the residual sum of squares is .