Skip to content

4.3-exam2-2001-spring

Midterm Exam 2, 2001 (spring) · Section 4.3: Least Squares Approximations Source: exam2_1.pdf, pp. 60-61, 64

Problem

3. (30pts.) An experiment at the seven times \(t = -3, -2, -1, 0, 1, 2, 3\) yields the consistent result \(b = 0\), except at the last time (\(t = 3\)), when we get \(b = 28\). We want the best straight line \(b = C + Dt\) to fit these seven data points by least squares.

(a) Write down the equation \(Ax = b\) with unknowns \(C\) and \(D\) that would be solved if a straight line exactly fit the data.

(b) Use the method of least squares to find the best fit values for \(C\) and \(D\).

(c) This problem is really that of projecting the vector \(b = (0, 0, 0, 0, 0, 0, 28)^T\) onto a certain subspace. Give a basis for that subspace, and give the projection \(p\) of \(b\) onto that subspace.

Solution 3a. \[ \begin{bmatrix} 1 & -3 \\ 1 & -2 \\ 1 & -1 \\ 1 & 0 \\ 1 & 1 \\ 1 & 2 \\ 1 & 3 \end{bmatrix} \begin{bmatrix} C \\ D \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 28 \end{bmatrix} \] 3b. \[ A^T A = \begin{bmatrix} 7 & 0 \\ 0 & 28 \end{bmatrix}, \quad \text{and} \quad A^T b = \begin{bmatrix} 28 \\ 84 \end{bmatrix}. \] Solving \((A^T A)x = A^T b\), we find that \[ x_{sol} = \begin{bmatrix} 4 \\ 3 \end{bmatrix}. \] 3c. A basis is given by the columns of \(A\): \[ \{(1, 1, 1, 1, 1, 1, 1)^T, (-3, -2, -1, 0, 1, 2, 3)^T\}. \] The projection is given by \[ p = Ax_{sol} = \begin{bmatrix} -5 \\ -2 \\ 1 \\ 4 \\ 7 \\ 10 \\ 13 \end{bmatrix}. \]

Keywords: least squares, straight line, normal equations, projection