Gaussian fit for Python

前端 未结 6 522
我寻月下人不归
我寻月下人不归 2020-11-27 04:06

I\'m trying to fit a Gaussian for my data (which is already a rough gaussian). I\'ve already taken the advice of those here and tried curve_fit and leasts

6条回答
  •  有刺的猬
    2020-11-27 04:50

    After losing hours trying to find my error, the problem is your formula:

    sigma = sum(y*(x-mean)**2)/n

    This previous formula is wrong, the correct formula is the square root of this!;

    sqrt(sum(y*(x-mean)**2)/n)

    Hope this helps

提交回复
热议问题