[SciPy-User] leastsq

Matt Newville newville@cars.uchicago....
Thu Jun 27 08:35:27 CDT 2013


Hi,

I'm pretty baffled by these questions.   optimize.leastsq() does not
take a covariance matrix as input, but can give one as output.   It
can take functions used to compute the Jacobian... Perhaps that would
accomplish what you're trying to do?

optimize.curve_fit() is a wrapper around leastsq() for the common case
of "fitting data" in which one has a set of observations at a set of
sampled "data points", and a set of variables used in a model for the
data.     Like leastsq(), it returns the covariance.  If curve_fit()
does what you need but seems sup-optimal, than leastsq() is probably
what you want to use.

Hope that helps, but maybe I'm not understanding what you're trying to do.

--Matt Newville


More information about the SciPy-User mailing list