4.3-exam2-2001-spring-makeup¶
Midterm Exam 2, 2001 (spring-makeup) · Section 4.3: Least Squares Approximations Source: exam2_1.pdf, p. 67
Problem¶
3. (30pts.) We look for the line \(y = C + Dt\) closest to the 3 points, \((t, y) = (0, -1)\) and \((1, 2)\) and \((2, -1)\).
(a) If the line went through all those points (it doesn't), what three equations would need to be solved?
(b) Find the best \(C\) and \(D\) by the least squares method.
(c) Explain the result you get for \(C\) and \(D\): How is the vector \(b = (-1, 2, -1)\) related to the plane you are projecting onto?
(d) What is the length of the error vector \(e\) ( = distance to plane = \(\|b - Ax\|\))?
Solution
3a. \[ C = -1, \quad C + D = 2, \quad C + 2D = -1, \qquad \begin{bmatrix} 1 & 0 \\ 1 & 1 \\ 1 & 2 \end{bmatrix} \begin{bmatrix} C \\ D \end{bmatrix} = \begin{bmatrix} -1 \\ 2 \\ -1 \end{bmatrix}. \] 3b. \[ A^T A = \begin{bmatrix} 3 & 3 \\ 3 & 5 \end{bmatrix}, \quad A^T b = \begin{bmatrix} -1 + 2 - 1 \\ 0 + 2 - 2 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \end{bmatrix}, \] so the best fit is \(C = D = 0\), i.e. the line \(y = 0\). 3c. \(A^T b = 0\), so \(b\) is in the nullspace of \(A^T\), the left nullspace. That is, \(b = (-1, 2, -1)\) is perpendicular to the plane (the column space of \(A\)) that we are projecting onto. Hence the projection \(p\) is the zero vector and the least squares line is the zero line. 3d. Since \(p = 0\), \[ \|e\| = \|b - Ax\| = \|b\| = \sqrt{(-1)^2 + 2^2 + (-1)^2} = \sqrt{6}. \]Keywords: least squares, straight line, left nullspace, error vector