[Numpy-discussion] Inversion of near singular matrices.

Gael Varoquaux gael.varoquaux at normalesup.org
Sun Jan 30 11:21:37 EST 2011

On Sun, Jan 30, 2011 at 04:15:34PM +0100, Sturla Molden wrote:
> Den 30.01.2011 07:28, skrev Algis Kabaila:
> > Why not simply numply.linalg.cond? This gives the condition
> > number directly (and presumably performs the inspection of
> > sv's). Or do you think that sv's give more useful information?

> You can use the singular value decomposition to invert the matrix, solve 
> linear systems and solve least squares problems. Looking at the topic 
> you don't just want to compute condition numbers, but invert the 
> ill-conditioned (nearly singular) matrix.

And if you are trying to solve a least-squares, I think that you should
be using a ridge (or Tikhonov) regularisation:
read in particular the paragraph above the table of content: you are
most likely interested in Gamma = alpha identity, where you set alpha to
be say 1% (or .1%) of the largest eigenvalue of A^t A.


More information about the NumPy-Discussion mailing list