Projections onto Subspaces

June 2, 2019

Projections

\begin{tikzpicture}[scale=1.0544]\small
\begin{axis}[axis line style=gray,
	samples=120,
	width=6.0cm,height=6.4cm,
	xmin=-1.5, xmax=3.5,
	ymin=-1.5, ymax=3.5,
	%restrict y to domain=-2:2,
	ytick={-1,0,1,2,3},
	xtick={-1,0,1,2,3},
	axis equal,
	axis x line=center,
	axis y line=center,
	xlabel=$x$,ylabel=$y$]
\addplot[->,color = {rgb:red,181;green,23;blue,23}, line width = 1pt] coordinates
           {(0,0) (3,1.5)};
\addplot[->,color = {rgb:red,16;green,133;blue,152}, line width = 1pt] coordinates {(0,0) (1,2)};
%p
\addplot[->,color = {rgb:red,16;green,133;blue,152}, line width = 1pt] coordinates {(0,0) (1.6,0.8)};
%e
\addplot[dashed, ->,color = {rgb:red,66;green,177;blue,8}, line width = 1pt] coordinates {(1.6,0.8) (1,2)};
% red vector label
\addplot[color = {rgb:red,181;green,23;blue,23}] coordinates {(3,1.8)} node{$\mathbf a$};
% blue vector label
\addplot[color = {rgb:red,16;green,133;blue,152}] coordinates {(1,2.3)} node{$\mathbf b$};
% dashed vector label
\addplot[color = {rgb:red,66;green,177;blue,8}] coordinates {(1.5,1.5)} node{$\mathbf e$};
% p vector label
\addplot[color = {rgb:red,16;green,133;blue,152}] coordinates {(1.5,0.4)} node{$\mathbf p$};
%zero node
\path (axis cs:0,0) node [anchor=north west,yshift=-0.07cm] {0};
\end{axis}
\end{tikzpicture}
Figure 1. Vector p projecting into vector a; resulting in p=xa; e=b-p

Let’s start with an example. On Figure 1, We have and both are one dimensional line in . We project into , and obtain its projected vector where (fraction here) is a constant, and the distance between the original and projected one . Since and is orthogonal, we have the following equation:

Solving it we get , and thus (x is constant so we can put it left or right)

Right now let’s separate in eq. (2). Let be the projection matrix . We rewrite eq. (1) as . is a very interesting matrix. What’s the column space of it? Since is an arbitrary vector put to the right of , and we get from it, no doubt:

What else? Hope you notice is symmetric by looking at the numerator (lecture 5). One other thing is that when we project a vector into twice, it’s the same vector (checkout multiply by again). Therefore

Why project?

We’ve talked last time that may not have solutions. is in the column space but may not. What can we do is to solve the closest equation to , which is

where is the projection of into the column space of (you will see why). And we can name this as since it’s not the original . So how to do this projection? Similar to above, but this time we want a general formula when is no longer a line. So imagine is a plane, constituted by the linear combinations of column vectors in which are .

Since there’re many vectors in , we need to pick the so that it can give us the closest approximations to . This happens when we have a perpendicular projection from to . That is, , and is perpendicular to . Being perpendicular to a whole matrix means it is perpendicular to every column in it. First . The vectors on the plane of is perpendicular to , so are other vectors . Therefore,

From this we can solve for in terms of original :

Solve eq. (4):

Then the projected vector is just

And the projection matrix is

Warning: since is not required to be a square matrix, we cannot do . is square. But still, is invertible if only if is full column rank.

Projections onto Subspaces - June 2, 2019 - Ruizhen Mai