How to fit polynomial to data with error bars

后端 未结 3 2435
旧时难觅i
旧时难觅i 2021-02-20 16:17

I am currently using numpy.polyfit(x,y,deg) to fit a polynomial to experimental data. I would however like to fit a polynomial that uses weighting based on the errors of the poi

3条回答
  •  遇见更好的自我
    2021-02-20 16:43

    Take a look at http://scipy-cookbook.readthedocs.io/items/FittingData.html in particular the section 'Fitting a power-law to data with errors'. It shows how to use scipy.optimize.leastsq with a function that includes error weighting.

提交回复
热议问题