I have a vector, $\textbf{z}$, which is $(n \times 1)$ and a matrix, $\textbf{A}$, which is $(n \times p)$. I want to find the linear transformation, $\textbf{w} = \textbf{A} \textbf{x}$, with the following three properties:
- It's orthogonal to $\textbf{z}$: $\hspace{1mm}$ $\textbf{z}^\top \textbf{w} = 0$
- It's centered: $\hspace{1mm}$ $\textbf{1}^\top \textbf{w} = 0$
- It has the maximum variance of any vector satisfying (1) and (2).
For (3), I'm trying to maximize $$ \frac{1}{n} \textbf{w}^\top \textbf{w} - \frac{1}{n^2} \textbf{w}^\top \textbf{1} \textbf{1}^\top \textbf{w}$$
I'm getting stuck trying to coerce the third constraint into a linear equation. Any help would be much appreciated.