Suppose we have a data vector $\boldsymbol{z}$ in R^{p} and a training data matrix $\boldsymbol{X}$ in $R^{p \times N}$, where N (N>p) is the number of samples in the training data matrix.
If we'd like to find the projection of $\boldsymbol{z}$ to the linear subspace spanned by the columns of $\boldsymbol{X}$, then we can solve the following unconstrained problem
min $||\boldsymbol{z} - \boldsymbol{X} \boldsymbol{b}||^2$.
The least squared estimation of $\boldsymbol{b}$ is $(\boldsymbol{X}' \boldsymbol{X})^{-1} \boldsymbol{X}' \boldsymbol{z}$. Thus the projection of $\boldsymbol{z}$ to the subspace can be written as $\boldsymbol{X}(\boldsymbol{X}' \boldsymbol{X})^{-1} \boldsymbol{X}' \boldsymbol{z} = \boldsymbol{P} \boldsymbol{z}$. $\boldsymbol{P} = \boldsymbol{X}(\boldsymbol{X}' \boldsymbol{X})^{-1} \boldsymbol{X}'$ is a projection matrix satisfying $\boldsymbol{P}' = \boldsymbol{P}$ and $\boldsymbol{P}^2 = \boldsymbol{P}$.
If we add nonnegative constraint to $\boldsymbol{b}$, then the above optimisation problem becomes
min $||\boldsymbol{z} - \boldsymbol{X} \boldsymbol{b}||^2$, s.t. every element in $\boldsymbol{b}$ is nonnegative.
The Lagrangian is $||\boldsymbol{z} - \boldsymbol{X} \boldsymbol{b}||^2 - \boldsymbol{v}^T \boldsymbol{b}$, where $\boldsymbol{v}$ is an N-dimensional vector. Setting the first order derivative of the Lagrangian w.r.t b to zero, we find the eistimation of $\boldsymbol{b}: (\boldsymbol{X}' \boldsymbol{X})^{-1} (\boldsymbol{X}' \boldsymbol{z} + 1/2 \boldsymbol{v})$. Thus the projection of $\boldsymbol{z}$ to the subspace is $\boldsymbol{X} (\boldsymbol{X}' \boldsymbol{X})^{-1} (\boldsymbol{X}' \boldsymbol{z} + 1/2 \boldsymbol{v})$.
My question now can be described as follows.
It seems to be hard to find a linear transformation $\boldsymbol{Q}$ that does not depend on $\boldsymbol{z}$ to calculate the projection of $\boldsymbol{z}$ with the nonnegative constraint. However, is there any method that can approximate such $\boldsymbol{Q}$? More specifically, can we approximate $\boldsymbol{X} (\boldsymbol{X}' \boldsymbol{X})^{-1} (\boldsymbol{X}' \boldsymbol{z} + 1/2 \boldsymbol{v})$ using $\boldsymbol{Qz}$, where $\boldsymbol{Q}$ is a projection matrix satisfying $\boldsymbol{Q}' = \boldsymbol{Q}$ and $\boldsymbol{Q}^2 = \boldsymbol{Q}$ and does not depend on $\boldsymbol{z}$? How can I estimate such $\boldsymbol{Q}$?
Thanks in advance!