I want to get the pseudoinverse of a sparse matrix.But the function
pinv() in matlab only works well for full matrix.Seemly, It is not a
good idea for converting sparse matrix to full matrix. Anyone knows
better idea for this task?
thanks a lot.
An alternative pseudo-inverse can be derived
from a QR. Assume your matrix is A. Then it is
easy enough to show that
P = inv(A'*A)*A'
has the right properties (see help for pinv.)
I do not recommend using this expression to
compute the pseudo-inverse though.
Instead, form the q-less QR decomposition of A.
r = qr(A,0);
A was sparse, so will be r.
Then form a pseudo-inverse by essentially
substituting for A in the expression for P
above. It will reduce to:
P=r\(r'\A');
A sparsely computable form of the pseudo-inverse.
Is it as well-behaved as the SVD form of the
pseudo-inverse? No. It might do in a pinch
though.
Cleve or Penny might want to step in here to
clarify the differences.
HTH,
John D'Errico
In article <eea98...@WebX.raydaftYaTP>, "Lifei Zhang"
<shifei...@yahoo.com> wrote:
--
According to your idea, I have got the satisfactory result. Also,
based on your opion, I learned a lot about the matrix inverxe.
Thanks again.
The pseudoinverse of a sparse matrix will typically be fully dense.
Depending on the size of your matrix it may not be practical to store
the full pseudo-inverse.
Do you really need the pseudo-inverse matrix? Or do you really want to
use the pseudo-inverse to find a minimum norm least squares solution?
If you really just want to find a least squares solution, then
iterative methods for the least squares problem (CGLS or LSQR) might
be appropriate.
--
Brian Borchers borc...@nmt.edu
Department of Mathematics http://www.nmt.edu/~borchers/
New Mexico Tech Phone: 505-835-5813
Socorro, NM 87801 FAX: 505-835-5366