Compute projection of vector onto nullspace of vector span

linear algebraprojection

Say I have a matrix $\pmb{W}$ of $m$ vectors, each of length $n$: $\pmb{W} =\left[ \vec{W}_1, \dots, \vec{W}_m\right]$, where $\vec{W}_i \in \mathbb{R}^n$ for integers $1\leq i\leq m$. How would I go about computing the projection a new vector, $\vec{V} \in \mathbb{R}^n$, onto the span of the nullspace of $\pmb{W}$?

When I compute the null space of $\pmb{W}$, I find a $nxm$ matrix. It is my understanding that I must have a square matrix in order to perform a projection. So, I am confused. It seems like $m$ would have to be equal to $n$ to perform the projection.

Finally, I experimented with a QR factorization to find a square projection matrix associated with $\pmb{W}$. After some experimentaiton, I did not think this was the right path and gave up.

Best Answer

This might be a useful approach to consider.

Given the following form:

$$ A\mathbf{x}=\mathbf{b} $$

where $A$ is $m \times n$, $\mathbf{x}$ is $n \times 1$, and $\mathbf{b}$ is $m \times 1$, then projection matrix $P$ which projects onto the subspace spanned by the columns of $A$, which are assumed to be linearly independent, is given by:

$$ P=A\left(A^{T}A\right)^{-1}A^{T} $$

which would then be applied to $\mathbf{b}$ as in:

$$ \mathbf{p}=P\mathbf{b} $$

In the case you are describing, the columns of $A$ would be the vectors which span the null-space that you have separately computed, and $\mathbf{b}$ is the vector $\vec{V}$ that you wish to project onto the null-space.

I hope this helps.