[SciPy-User] Return sigmas from curve_fit

josef.pktd@gmai... josef.pktd@gmai...
Tue Oct 16 14:45:01 CDT 2012


On Tue, Oct 16, 2012 at 3:32 PM, Gökhan Sever <gokhansever@gmail.com> wrote:
> Thanks Travis.
>
> That doesn't indeed, I missed the part that part of the curve_fit return was
> variance of the estimate(s).
>
> 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. I guess
> IDL's result is slightly wrong when the default tol value is used (The
> default value is 1.0 x  10-3.) comparing to the SciPy's default ftol of
> 1.49012e-08.

For the standard errors of the parameter estimates it is also possible that
the numerical derivatives in curve_fit/leastsq don't have very high
precision.

I think we have seen cases like that, but don't remember any details.

Josef

>
>
> On Tue, Oct 16, 2012 at 12:11 PM, Travis Oliphant <travis@continuum.io>
> wrote:
>>
>> If I understand your question, then taking the square root of the diagonal
>> elements of the second return from curve_fit.
>>
>> np.sqrt(pcov.diagonal())
>>
>> Should give you the standard deviations...
>>
>> -Travis
>>
>> On Oct 16, 2012, at 1:07 PM, Gökhan Sever wrote:
>>
>> Hello,
>>
>> Is there a way to return standard deviations of the best fit parameters
>> from curve_fit like in IDL's curvefit function?
>>
>>
>> PS:
>>
>> http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html
>> http://www.exelisvis.com/docs/CURVEFIT.html
>>
>> --
>> Gökhan
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
>>
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
>
>
>
> --
> Gökhan
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-User mailing list