last time:
Detailed description
component of \( \vec{y} \) orthogonal to \( \vec{u} \)
orthogonal projection of \( \vec{y} \) onto \( \vec{u} \)
component of \( \vec{y} \) orthogonal to \( \vec{u} \)
orthogonal projection of \( \vec{y} \) onto \( \vec{u} \)
If \( \{ \vec{u}_1, \dots, \vec{u}_p \} \) is orthogonal basis for \( W \), then projection of \( \vec{y} \) onto \( W \) is uniquely determined as
\[ \hat{y} = \frac{\vec{y} \cdot \vec{u}_1}{\vec{u}_1 \cdot \vec{u}_1} \vec{u}_1 + \frac{\vec{y} \cdot \vec{u}_2}{\vec{u}_2 \cdot \vec{u}_2} \vec{u}_2 + \dots + \frac{\vec{y} \cdot \vec{u}_p}{\vec{u}_p \cdot \vec{u}_p} \vec{u}_p \]independent of the basis used (as long as it is orthogonal)
Find \( \operatorname{proj}_W \vec{y} \) where \( W = \operatorname{span}\{ \vec{u}_1, \vec{u}_2 \} \)
\( \vec{u}_1 \cdot \vec{u}_2 = 0 \), \( \vec{u}_1 \perp \vec{u}_2 \)
\[ \hat{y} = \frac{\vec{y} \cdot \vec{u}_1}{\vec{u}_1 \cdot \vec{u}_1} \vec{u}_1 + \frac{\vec{y} \cdot \vec{u}_2}{\vec{u}_2 \cdot \vec{u}_2} \vec{u}_2 \]Try another basis: \( \left\{ \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix}, \begin{bmatrix} -3 \\ 2 \\ -3 \end{bmatrix} \right\} \) (labeled \( \vec{u}_1 \) and \( \vec{u}_2 \)) also spans the same \( W \).
Given \( \vec{y} = \begin{bmatrix} -9 \\ -1 \\ 1 \end{bmatrix} \):
\[ \begin{aligned} \hat{y} &= \frac{-9 - 1}{1 + 1} \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix} + \frac{27 - 2 - 3}{9 + 4 + 9} \begin{bmatrix} -3 \\ 2 \\ -3 \end{bmatrix} \\ &= (-5) \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix} + (1) \begin{bmatrix} -3 \\ 2 \\ -3 \end{bmatrix} = \begin{bmatrix} -8 \\ 2 \\ 2 \end{bmatrix} \quad \text{(same as before)} \end{aligned} \]\[ \vec{z} = \vec{y} - \hat{y} = \begin{bmatrix} -9 \\ -1 \\ 1 \end{bmatrix} - \begin{bmatrix} -8 \\ 2 \\ 2 \end{bmatrix} = \begin{bmatrix} -1 \\ -3 \\ -1 \end{bmatrix} \]The closest distance between \( \vec{y} \) and \( W \) is \( \|z\| = \sqrt{11} \).
What is the point in \( W \) that is closest to \( \vec{y} \)?
\( \rightarrow \) tip of \( \hat{y} \): \( (-8, 2, 2) \)
\[ \vec{u}_1 = \begin{bmatrix} -7 \\ 1 \\ 4 \end{bmatrix}, \quad \vec{u}_2 = \begin{bmatrix} -1 \\ 1 \\ -2 \end{bmatrix}, \quad \vec{y} = \begin{bmatrix} -9 \\ -1 \\ 1 \end{bmatrix} \]Find \( c_1 \) and \( c_2 \) such that \( \vec{y} = c_1 \vec{u}_1 + c_2 \vec{u}_2 \), but if \( \vec{y} \) is not in \( \operatorname{span}\{ \vec{u}_1, \vec{u}_2 \} \), then there are no solutions.
Columns correspond to variables \( c_1 \) and \( c_2 \) respectively.
Pivot in rightmost column (\( -11 \)) \( \rightarrow \) inconsistent system.
From earlier:
\[ \hat{y} = (1)\vec{u}_1 + (1)\vec{u}_2 \]The coefficients \( (1) \) and \( (1) \) are the closest \( c_1, c_2 \) to the true solution.
\( \vec{u}_1 \cdot \vec{u}_2 = 0 \), so \( \vec{u}_1 \perp \vec{u}_2 \) but \( \vec{u}_3 \) is not orthogonal to either.
If we know \( \vec{u}_3 \) is not in \( \operatorname{span}\{\vec{u}_1, \vec{u}_2\} \), find a nonzero vector that is orthogonal to both \( \vec{u}_1 \) and \( \vec{u}_2 \).
\( \vec{z} \) is \( \perp \) to both \( \vec{u}_1 \) and \( \vec{u}_2 \)
\[\begin{aligned}\hat{u}_3 &= \frac{\vec{u}_3 \cdot \vec{u}_1}{\vec{u}_1 \cdot \vec{u}_1} \vec{u}_1 + \frac{\vec{u}_3 \cdot \vec{u}_2}{\vec{u}_2 \cdot \vec{u}_2} \vec{u}_2 \\&= \frac{-2}{6} \begin{bmatrix} 1 \\ 1 \\ -2 \end{bmatrix} + \frac{2}{30} \begin{bmatrix} 5 \\ -1 \\ 2 \end{bmatrix} \\&= \begin{bmatrix} 0 \\ -2/5 \\ 4/5 \end{bmatrix}\end{aligned}\]this is orthogonal to both \( \vec{u}_1 \) and \( \vec{u}_2 \)
If \( \{ \vec{u}_1, \dots, \vec{u}_p \} \) is an orthonormal basis for \( W \)
if \( U = \begin{bmatrix} \vec{u}_1 & \vec{u}_2 & \dots & \vec{u}_p \end{bmatrix} \)
then
\[ \operatorname{proj}_W \vec{y} = U U^T \vec{y} \]\( \{ \vec{u}_1, \vec{u}_2 \} \) is orthogonal but not orthonormal
but \( \left\{ \frac{\vec{u}_1}{\|\vec{u}_1\|}, \frac{\vec{u}_2}{\|\vec{u}_2\|} \right\} \) is
\[ = \left\{ \begin{bmatrix} 1/\sqrt{2} \\ 0 \\ -1/\sqrt{2} \end{bmatrix}, \begin{bmatrix} -3/\sqrt{22} \\ 2/\sqrt{22} \\ -3/\sqrt{22} \end{bmatrix} \right\}, \quad U = \begin{bmatrix} 1/\sqrt{2} & -3/\sqrt{22} \\ 0 & 2/\sqrt{22} \\ -1/\sqrt{2} & -3/\sqrt{22} \end{bmatrix} \]\[ \begin{aligned} \hat{y} &= \operatorname{proj}_W \vec{y} = U U^T \vec{y} = \begin{bmatrix} 1/\sqrt{2} & -3/\sqrt{22} \\ 0 & 2/\sqrt{22} \\ -1/\sqrt{2} & -3/\sqrt{22} \end{bmatrix} \begin{bmatrix} 1/\sqrt{2} & 0 & -1/\sqrt{2} \\ -3/\sqrt{22} & 2/\sqrt{22} & -3/\sqrt{22} \end{bmatrix} \begin{bmatrix} -9 \\ -1 \\ 1 \end{bmatrix} \\ &= \begin{bmatrix} 10/11 & -3/11 & -1/11 \\ -3/11 & 2/11 & -3/11 \\ -1/11 & -3/11 & 10/11 \end{bmatrix} \begin{bmatrix} -9 \\ -1 \\ 1 \end{bmatrix} = \begin{bmatrix} -8 \\ 2 \\ 2 \end{bmatrix} \end{aligned} \]