[SciPy-User] Return sigmas from curve_fit

josef.pktd@gmai... josef.pktd@gmai...
Tue Oct 16 16:24:30 CDT 2012


On Tue, Oct 16, 2012 at 4:39 PM, Daπid <davidmenhur@gmail.com> wrote:
> 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.

Only if you have small samples and then you still only have a local
approximation because of the nonlinearity and derivatives.

In larger samples the law of large numbers implies that the
estimates are normal distributed with the given covariance
matrix under pretty general conditions.

(least squares is semi-parametric and doesn't assume a
specific distribution in large samples)

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,

sounds like bootstrap standard errors.

Josef

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).
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user


More information about the SciPy-User mailing list