Python / Scipy - implementing optimize.curve_fit 's sigma into optimize.leastsq

前端 未结 3 760
日久生厌
日久生厌 2021-01-12 21:03

I am fitting data points using a logistic model. As I sometimes have data with a ydata error, I first used curve_fit and its sigma argument to include my individual standard

3条回答
  •  轮回少年
    2021-01-12 21:26

    I just found that it is possible to combine the best of both worlds, and to have the full leastsq() output also from curve_fit(), using the option full_output:

    popt, pcov, infodict, errmsg, ier = curve_fit(func, xdata, ydata, sigma = SD, full_output = True)
    

    This gives me infodict that I can use to calculate all my Goodness of Fit stuff, and lets me use curve_fit's sigma option at the same time...

提交回复
热议问题