4.3-exam2-2015¶
Exam II, 2015 · Section 4.3: Least Squares Approximations Source: exam2_2.pdf, pp. 96, 100
Problem¶
1. (33 points) Suppose we measure \(b = 0, 0, 0, 1, 0, 0, 0\) at times \(t = -3, -2, -1, 0, 1, 2, 3\).
(a) To fit these 7 measurements by a straight line \(C + Dt\), what 7 equations \(Ax = b\) would we want to solve?
(b) Find the least squares solution \(\widehat{x} = (\widehat{C}, \widehat{D})\).
(c) The projection of that vector \(b\) in \(R^7\) onto the column space of \(A\) is what vector \(p\)?
Solution
(a) We want to solve the following 7 equations: \(C - 3D = 0\), \(C - 2D = 0\), \(C - D = 0\), \(C = 1\), \(C + D = 0\), \(C + 2D = 0\), and \(C + 3D = 0\). (b) First we need to find the projection of \(b\) onto the plane generated by the two vectors \((1, 1, 1, 1, 1, 1, 1)\) and \((-3, -2, -1, 0, 1, 2, 3)\). As \(b\) is perpendicular to the second vector, we only need to find the projection of \(b\) on the line generated by the first vector, which is \((1/7, 1/7, 1/7, 1/7, 1/7, 1/7, 1/7)\). Now we need to solve the seven equations \(C - 3D = 1/7\), \(C - 2D = 1/7\), \(C - D = 1/7\), \(C = 1/7\), \(C + D = 1/7\), \(C + 2D = 1/7\), and \(C + 3D = 1/7\), and we get \(C = 1/7\) and \(D = 0\). Alternatively, we can denote by \(A\) the matrix that has these two vectors as its two columns, then \(A^TA = \begin{bmatrix} 7 & 0 \\ 0 & 28 \end{bmatrix}\) and \(A^Tb = (1, 0)\). The two equations corresponding to \(A^TA\widehat{x} = A^Tb\) are \(7C = 1\) and \(28D = 0\), resulting in the same solution \(C = 1/7\) and \(D = 0\). (c) If we used the first method above, we already calculated the projection as \((1/7, 1/7, 1/7, 1/7, 1/7, 1/7, 1/7)\). If we used the second method, the projection is \(A\widehat{x} = (1/7, 1/7, 1/7, 1/7, 1/7, 1/7, 1/7)^T\).Keywords: least squares, projection, straight line fit, normal equations