[SciPy-User] curve_fit error: Optional parameters not found...

Travis Oliphant oliphant@enthought....
Tue Jun 8 23:34:22 CDT 2010

On Jun 8, 2010, at 11:36 AM, Jeremy Conlin wrote:

> I downloaded scipy 0.8b1 yesterday; I was excited to try out the new
> curve_fit function.  Today I have been playing with it and some of the
> time it works.  Other times I get the error:
> RuntimeError: Optimal parameters not found: Both actual and predicted
> relative reductions in the sum of squares
>  are at most 0.000000 and the relative error between two consecutive
> iterates is at
>  most 0.000000

At the core of this routine is a nonlinear least-squares optimization.   Optimization algorithms can fail to converge.  It looks like that is happening here.   You can try providing weights to your data-points or adjusting the function that is being fit. 

The "fix" could be to improve the error reporting and handling, but there are always going to be cases where the algorithm won't be able to find an optimum. 


More information about the SciPy-User mailing list