[SciPy-user] optimize.leastsq ier flag
Tue Jul 31 10:30:07 CDT 2007
I'm getting an ier flag of '4' when I run this code to fit some data to
p0 = [1, 1, 1]
gauss = lambda p, x: p*numpy.exp(-((x-p)**2/(2*p**2)))
res = lambda p, x, y: gauss(p, x) - y
optimized, success = optimize.minpack.leastsq(res, p0, args = (omega,
print 'success flag:', success
In the minpack documentation, there is supposedly a 'mesg' return value,
mesg -- a string message giving information about the cause of failure.
So.. first, does anyone know what a flag of '4' means? Secondly, how
would you go about getting this flag? I tried
optimized, mesg, success = optimize.minpack.leastsq(res, p0, args =
with no luck..
ValueError: need more than 2 values to unpack
Any help would be greatly appreciated.
More information about the SciPy-user