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] Help in speeding up accumulation in a matrix

2011-01-29 Thread josef . pktd
On Sat, Jan 29, 2011 at 5:30 PM, Charles R Harris wrote: > > > On Sat, Jan 29, 2011 at 2:01 PM, Nicolas SCHEFFER > wrote: >> >> Hi all, >> >> First email to the list for me, I just want to say how grateful I am >> to have python+numpy+ipython etc... for my day to day needs. Great >> combination o

Re: [Numpy-discussion] numpy.linalg.svd documentation

2011-01-29 Thread Charles R Harris
On Sat, Jan 29, 2011 at 6:58 PM, Jason Grout wrote: > The SVD documentation seems a bit misleading. It says: > > Factors the matrix a as u * np.diag(s) * v, where u and v are unitary > and s is a 1-d array of a‘s singular values. > > However, that only is true (i.e., you just have to do np.diag(s

Re: [Numpy-discussion] numpy.linalg.svd documentation

2011-01-29 Thread josef . pktd
On Sat, Jan 29, 2011 at 8:58 PM, Jason Grout wrote: > The SVD documentation seems a bit misleading.  It says: > > Factors the matrix a as u * np.diag(s) * v, where u and v are unitary > and s is a 1-d array of a‘s singular values. > > However, that only is true (i.e., you just have to do np.diag(s

[Numpy-discussion] numpy.linalg.svd documentation

2011-01-29 Thread Jason Grout
The SVD documentation seems a bit misleading. It says: Factors the matrix a as u * np.diag(s) * v, where u and v are unitary and s is a 1-d array of a‘s singular values. However, that only is true (i.e., you just have to do np.diag(s) to get S) in general if full_matrices is False, which is no

Re: [Numpy-discussion] Help in speeding up accumulation in a matrix

2011-01-29 Thread eat
Hi, On Sat, Jan 29, 2011 at 11:01 PM, Nicolas SCHEFFER < scheffer.nico...@gmail.com> wrote: > Hi all, > > First email to the list for me, I just want to say how grateful I am > to have python+numpy+ipython etc... for my day to day needs. Great > combination of software. > > Anyway, I've been havi

Re: [Numpy-discussion] Wiener filter / decorrelation

2011-01-29 Thread Sturla Molden
Didn't I recommend the C++ and Fortran versions of 2nd edition? I particularly like the Fortran 90 edition as NumPy behaves like a vector machine as well. (The algorithms are explained in the Fortran 77 text, so they must be read together.) I'd like to warn against NR in C (all algorithms cont

Re: [Numpy-discussion] Help in speeding up accumulation in a matrix

2011-01-29 Thread Charles R Harris
On Sat, Jan 29, 2011 at 2:01 PM, Nicolas SCHEFFER < scheffer.nico...@gmail.com> wrote: > Hi all, > > First email to the list for me, I just want to say how grateful I am > to have python+numpy+ipython etc... for my day to day needs. Great > combination of software. > > Anyway, I've been having thi

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] Help in speeding up accumulation in a matrix

2011-01-29 Thread Nicolas SCHEFFER
Thanks for the prompt reply! I quickly tried that and it actually helps compared to the full vectorized version. Depending on the dimensions, the chunk size has to be tuned (typically 100 or so) But I don't get any improvement w/r to the simple for loop (i can almost match the time though). My gue

Re: [Numpy-discussion] Help in speeding up accumulation in a matrix

2011-01-29 Thread Benjamin Root
On Saturday, January 29, 2011, Nicolas SCHEFFER wrote: > Hi all, > > First email to the list for me, I just want to say how grateful I am > to have python+numpy+ipython etc... for my day to day needs. Great > combination of software. > > Anyway, I've been having this bottleneck in one my algorithm

[Numpy-discussion] Help in speeding up accumulation in a matrix

2011-01-29 Thread Nicolas SCHEFFER
Hi all, First email to the list for me, I just want to say how grateful I am to have python+numpy+ipython etc... for my day to day needs. Great combination of software. Anyway, I've been having this bottleneck in one my algorithms that has been bugging me for quite a while. The objective is to sp

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