[SciPy-User] Return sigmas from curve_fit

Daπid davidmenhur@gmail....
Tue Oct 16 15:39:51 CDT 2012

On Tue, Oct 16, 2012 at 9:32 PM, Gökhan Sever <gokhansever@gmail.com> wrote:
> I am comparing IDL's curvefit and Scipy's curve_fit, and got slightly
> different results for the same data using the same fit function.

Curve fitting is a delicated matter.

It must be noted that the values of the covariance matrix assume that
the errors are distributed normally, but this is not always true. In
that case, if you want precise values of the errors, you should shot
higher: either add some random noise to your data following the
adequate distribution and run it several times, or else switching to
other algorithms. MINUIT works quite well for this, and it can even
return asymmetric error estimates. The first is slower, but I think is
the one that can best represent the true shape of the errors if the
source is pure noise (uncorrelated).

More information about the SciPy-User mailing list