[Numpy-discussion] SVD error in Numpy. Bug?
Tue Mar 18 14:53:16 CDT 2008
I think it could happen, the search for an eignevalue is an iterative
process that can diverge sometimes. All SVD implementations have this hard
coded-limitation, so that the biorthogonalization can finish in finite time.
What is the determinant of your matrix ?
2008/3/18, Lou Pecora <firstname.lastname@example.org>:
> I have run into a failure of complex SVD in numpy
> (version='18.104.22.168'). The error is:
> line 767, in svd
> raise LinAlgError, 'SVD did not converge'
> numpy.linalg.linalg.LinAlgError: SVD did not converge
> The matrix is complex 36 x 36. Very slight changes in
> the matrix components (~ one part in 10^4) are enough
> to make the error go away. I have never seen this
> before and it goes against the fact (I think it's a
> mathematical fact) that SVD always exists. A
> hard-coded upper limit on the iteration number allowed
> somewhere in the SVD C code seems to be the problem.
> Read on.
> A google search turned up a few messages, included
> this one from 2002 where the same error occurred
> infrequently, but randomly (it seemed):
> One online message in August 2002:
> Ok, so after several hours of trying to read that
> code, I found
> the parameter that needs to be tuned. In case anyone
> has this
> problem and finds this thread a year from now, here's
> your hint:
> File: Src/dlapack_lite.c
> Subroutine: dlasd4_
> Line: 22562
> There's a for loop there that limits the number of
> iterations to
> 20. Increasing this value to 50 allows my matrix to
> I have not bothered to test what the "best" value for
> this number
> is, though. In any case, it appears the number just
> exists to
> prevent infinite loops, and 50 isn't really that much
> closer to
> infinity than 20.... (Actually, I'm just going to set
> it to 100
> so I don't have to think about it ever again.)
> Damian Menscher
> -=#| Physics Grad Student & SysAdmin @ U Illinois
> Urbana-Champaign |#=-
> -=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801
> Ofc:(217)333-0038 |#=-
> -=#| 1412 DCL, Workstation Services Group, CITES
> Ofc:(217)244-3862 |#=-
> -=#| <menscher at uiuc.edu> www.uiuc.edu/~menscher/
> Fax:(217)333-9819 |#=-
> I have looked in Src/dlapack_lite.c and line 22562 is
> no longer a line that sets a max. iterations
> parameter. There are several set in the file, but
> that code is hard to figure (sort of a Fortran-in-C
> Here's one, for example:
> maxit = *n * 6 * *n; // Line 887
> I have no idea which parameter to tweak. Apparently
> this error is still in numpy (at least to my version).
> Does anyone have a fix? Should I start a ticket (I
> think this is what people do)? Any help appreciated.
> I'm using a Mac Book Pro (Intel chip), system 10.4.11,
> Python 2.4.4.
> -- Lou Pecora, my views are my own.
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
> Numpy-discussion mailing list
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion