[Numpy-discussion] Inversion of near singular matrices.
akabaila at pcug.org.au
Sun Jan 30 01:28:32 EST 2011
On Sunday 30 January 2011 16:35:15 Charles R Harris wrote:
> On Sat, Jan 29, 2011 at 10:11 PM, Algis Kabaila
<akabaila at pcug.org.au>wrote:
> > On Sunday 30 January 2011 09:10:30 Sturla Molden wrote:
> > > Den 29.01.2011 12:40, skrev Algis Kabaila:
> > > > So my question is: how can one reliably detect
> > > > singularity (or near singularity) and raise an
> > > > exception?
> > >
> > > Use an SVD, examine the singular values.
> > I gather that SVD is the Singular Value Decomposition, but
> > I have no idea how to perform such decomposition.
> Use numpy.linalg.svd. The condition number is the ratio of
> the largest singular value to the smallest.
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?
Thanks for writing - I find it all rather fascinating...
More information about the NumPy-Discussion