Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-31 Thread Algis Kabaila
On Tuesday 01 February 2011 03:27:22 Sturla Molden wrote: > Den 31.01.2011 03:05, skrev Algis Kabaila: > > Actually, the structural engineer > > has no interest in trying to invert a singular matrix. > > However he/she is interested (or should be interested :) > > ) when the square response matri

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-31 Thread Sturla Molden
Den 31.01.2011 03:05, skrev Algis Kabaila: > Actually, the structural engineer > has no interest in trying to invert a singular matrix. However > he/she is interested (or should be interested :) ) when the > square response matrix might approach singularity for this would > signal instability. I

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-30 Thread Algis Kabaila
> > And if you are trying to solve a least-squares, I think that > you should be using a ridge (or Tikhonov) regularisation: > http://en.wikipedia.org/wiki/Tikhonov_regularization > read in particular the paragraph above the table of content: > you are most likely interested in Gamma = alpha ident

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-30 Thread Gael Varoquaux
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 informatio

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-30 Thread Bruce Southey
On Sun, Jan 30, 2011 at 9:15 AM, 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

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-30 Thread Sturla Molden
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,

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-29 Thread Algis Kabaila
On Sunday 30 January 2011 16:35:15 Charles R Harris wrote: > On Sat, Jan 29, 2011 at 10:11 PM, Algis Kabaila 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 > > > > singularit

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-29 Thread Charles R Harris
On Sat, Jan 29, 2011 at 10:11 PM, Algis Kabaila 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, e

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-29 Thread Algis Kabaila
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 Valu

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-29 Thread Algis Kabaila
On Saturday 29 January 2011 22:47:23 Stuart Brorson wrote: > > So my question is: how can one reliably detect singularity > > (or near singularity) and raise an exception? > > Matrix condition number: > > http://docs.scipy.org/doc/numpy/reference/generated/numpy.lin > alg.cond.html http://en.wiki

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-29 Thread Sturla Molden
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. One or more small singular values indicate ill-conditioning. (What constitutes a small singular value i

Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-29 Thread Stuart Brorson
> So my question is: how can one reliably detect singularity (or > near singularity) and raise an exception? Matrix condition number: http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.cond.html http://en.wikipedia.org/wiki/Condition_number Stuart __

[Numpy-discussion] Inversion of near singular matrices.

2011-01-29 Thread Algis Kabaila
Hi, I am interested in determining if a matrix is singular or "nearly singular" - very ill conditioned. The problem occurs in structural engineering applications. My OS is kubuntu 10.10 (32 bit) Python 2.6.6 numpy and numpy.linalg binaries from ubuntu repositories. The attached tar ball has