## Linear Algebra and Its Applications, Exercise 3.3.18

Exercise 3.3.18. Suppose we have the following measurements of $y$:

$y = 3, t = 1, z = 1$

$y = 5, t = 2, z = 1$

$y = 6, t = 0, z = 3$

$y = 0, t = 0, z = 0$

and want to fit a plane of the form $y = C + Dt + Ez$.

a) Write a system of 4 equations in 3 unknowns representing the problem. (The system may not have a solution.)

b) Write a system of 3 equations in 3 unknowns  representing the least squares solution to the problem.

Answer: a) The original problem can be expressed as the following system $Ax = b$ of 4 equations in 3 unknowns:

$\begin{bmatrix} 1&1&1 \\ 1&2&1 \\ 1&0&3 \\ 1&0&0 \end{bmatrix} \begin{bmatrix} C \\ D \\ E \end{bmatrix} = \begin{bmatrix} 3 \\ 5 \\ 6 \\ 0 \end{bmatrix}$

From the fourth equation we have $C=0$ and then substituting into the third equation we have $E=2$. However we then get differing values of $D$ depending on whether we substitute into the second equation or the first. The system has no solution $x$ as written.

b) The least square solutions amounts to solving the system $A^TA\bar{x} = A^Tb$ that minimizes the error vector $b - A\bar{x}$. We have

$A^TA = \begin{bmatrix} 1&1&1&1 \\ 1&2&0&0 \\ 1&1&3&0 \end{bmatrix} \begin{bmatrix} 1&1&1 \\ 1&2&1 \\ 1&0&3 \\ 1&0&0 \end{bmatrix}$

$= \begin{bmatrix} 4&3&5 \\ 3&5&3 \\ 5&3&11 \end{bmatrix}$

and

$A^Tb = \begin{bmatrix} 1&1&1&1 \\ 1&2&0&0 \\ 1&1&3&0 \end{bmatrix} \begin{bmatrix} 3 \\ 5 \\ 6 \\ 0 \end{bmatrix} = \begin{bmatrix} 14 \\ 13 \\ 26 \end{bmatrix}$

so that the resulting system of 3 equations in 3 unknowns $A^TA\bar{x} = A^Tb$ is

$\begin{bmatrix} 4&3&5 \\ 3&5&3 \\ 5&3&11 \end{bmatrix} \begin{bmatrix} \bar{C} \\ \bar{D} \\ \bar{E} \end{bmatrix} = \begin{bmatrix} 14 \\ 13 \\ 26 \end{bmatrix}$

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fifth Edition and the accompanying free online course, and Dr Strang’s other books.

This entry was posted in linear algebra and tagged , . Bookmark the permalink.