$y=N(N^TT N)^{-1}N^TT$

50 Views Asked by At

Let $T$ be a square $n\times n$ matrix. This matrix is symmetric and positive definite.

Let $N$ be a $n\times s$ matrix where $s<n$. I want to be able to compute: $$y=N(N^TT N)^{-1}N^TT$$

I can compute $y$ easily when the dimension $n$ is small, but when $n$ is above 200, then the problem becomes badly scaled and I seem to be unable to compute $y$ efficiently. I use Matlab to do my computations.

Are there any tricks or identity that I could use to compute $y$?

Thank you!

1

There are 1 best solutions below

1
On BEST ANSWER

Let $N^TTN = R^TR$ where $R$ is $s \times s$. Let $T_2 = N R^{-1}$ (that is, $N = T_2R$) and set $T_1 = TT_2$ (so that $TN = TT_2R = T_1R$ and hence $N^T T = R^TT_2^TT$). Then $$N(N^T T N)^{-1}N^TT = T_2R(R^TR)^{-1} R^TT_2^TT = T_2T_2^TT \, .$$ So you have to precompute $N^TTN$, find a square root $R$ e.g. with the Cholesky factorization, compute $T_2 = NR^{-1}$, and then $T_2T_2^TT$.

It's the same computation, but it might avoid some of the problems with conditioning since $R$ is better conditioned than $N^TTN$..