[SciPy-User] Using leastsq(), fmin(), anneal() to do a least squares fit

Andreas lists@hilboll...
Wed Jun 30 13:55:47 CDT 2010

Hi there,

I have an optimization problem in 12 variables.

I first wrote a functino toBeMinimized(), which outputs these 12
variables as one array. Trying to solve this problem with leastsq(), I
noticed that however i play around with the parameters, the function
does not seem to find the global optimum.

So I figured I'd try some other functions from scipy.optimize, starting
with anneal(). I wrote a wrapper function around my original
toBeMinimized(), doing nothing but call
np.sum(toBeMinimized(params)**2). Now, however, the results I get from
anneal vary widely, and don't seem to have anything in common with the
results from leastsq().

Basically the same happens when I use fmin() instead of anneal().

I'm somewhat at a loss here. leastsq() seems to give the most consistent
results, but still they vary too much to be too useful for me.

Any ideas?

Thanks for your insight,


More information about the SciPy-User mailing list