[SciPy-User] Return sigmas from curve_fit
Tue Oct 16 16:24:30 CDT 2012
On Tue, Oct 16, 2012 at 4:39 PM, Daπid <firstname.lastname@example.org> wrote:
> On Tue, Oct 16, 2012 at 9:32 PM, Gökhan Sever <email@example.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)
> 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.
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
More information about the SciPy-User