[SciPy-User] 2 questions: optimize.leastsq

Denis Laxalde denis.laxalde@mcgill...
Tue Oct 25 08:21:34 CDT 2011

On Tue, 25 Oct 2011 12:49:37 +0200,
Johannes Radinger wrote:
> It's all about the optimize.leastsq. I use that to fit a function with several conditions. As a result I get the parameter estimates I am looking for and the 'ier'. According to the manual this is:
> "An integer flag. If it is equal to 1, 2, 3 or 4, the solution was found. Otherwise,
> the solution was not found"
> I just want to know: What exactly do the numbers mean? What is if it is 1 or 2? Is that any information
> about the quality of the fit?

These numbers indicate how the solver terminated, i.e. based on which
criterion. You may have a look at the 'mesg' output which describes
how the solver terminated. The documentation is probably
misleading here as it describes mesg as a "message giving information
about the cause of failure" whereas it's actually a general message.

Denis Laxalde

More information about the SciPy-User mailing list