[SciPy-user] Optimization Working only with a Specific Expression of the input Parameters

Christian Kristukat ckkart@hoc....
Sat Mar 3 18:17:51 CST 2007


Hi Lorenzo,

Lorenzo Isella wrote:
> Actually I already posted this on the mailing list, but nevertheless I
> will give it another try.

Sorry I have not seen it.
The problem is as you guessed that leastsq is trying negative parameters which
will turn the residual complex. But the reason is simple and easy to solve: your
initital guess for the first parameters is bad:

> print "the initial guesses are"
> p0 = [50000.0,90.0, 1.59]

If you set it to 1e8 it works very well.

Christian


More information about the SciPy-user mailing list