[SciPy-user] singular matrix linalg.basic.LinAlgError in optimize.leastsq

Travis Oliphant oliphant.travis at ieee.org
Tue Apr 25 02:17:05 EDT 2006


Taro Sato wrote:
> I frequently use optimize.leastsq, and there is this annoying tendency
> for the routine to throw an exception when the resulting covariant
> matrix ends up singular.  The error message follows.
>
> Basically, I need full_output=1 to just obtain a stopping condition in
> the output parameter ier, but the way the code prepare the full
> output, it also tries to compute covariant matrix.  The problem is
> when it fails, it throws an exception which is not handled within
> minpack.py:
>   

This is a good suggestion.  Unfortunately, this year has been very busy 
for me and I have not been able to spend much time on SciPy (most of my 
Python time has been spent on NumPy).  

Fortunately, other SciPy developers have helped but we could use more 
who can make these kinds of changes. 

Think about submitting a patch (please at least enter a ticket on the 
Trac page for SciPy).   This can help.

-Travis





More information about the SciPy-User mailing list