[Math] the difference between the projection onto the column space and projection onto row space

linear algebra

If I see a question that asks "find the projection a vector $b$ onto a matrix $A$" I would either solve by using $A^TA\hat x =A^Tb$ and then the projection would equal $A\hat x$,

and if the matrix $A$ was orthogonal then I would use $proj_bA = \frac{b \cdot q_1}{q_1 \cdot q_1}q_1 + … + \frac{b \cdot q_k}{q_k \cdot q_k}q_k$ where $q_k$ represents the $k^{th}$ vector in matrix $A$.

My question is what if a question says find the projection of some vector $b$ onto the column/row space of matrix $A$?
What does this mean and what would I need to do differently to calculate it?

Best Answer

if the columns of matrix $A$ are linearly independent, the projection of a vector, $b$, onto the column space of A can be computed as

$$P=A(A^TA)^{-1}A^T$$

From here.

Wiki seems to say the same. It also says here that

The column space of $A$ is equal to the row space of $A^T$.

I'm guessing that

if the rows of matrix $A$ are linearly independent, the projection of a vector, $b$, onto the row space of A can be computed as

$$P=A^T(AA^T)^{-1}A$$