对于不对称的不确定性,scipy.optimize.curve_fit 的 sigma 输入应该是什么?
我阅读了 scipy.optimize.curve_fit 的文档,但 sigma 对我来说仍然不清楚。
我确实明白 sigma 在这里的用途,但我不明白,我应该如何在不对称不确定性的情况下实际使用它。
文档: https:// docs.scipy.org/doc/scipy/reference/ generated/scipy.optimize.curve_fit.html#scipy.optimize.curve_fit
详细描述:
文档说:
如果我们将残差定义为 r = ydata - f(xdata, *popt),则 sigma 的解释取决于其维数:
一维 sigma 应包含 ydata 中误差的标准差值。在本例中,优化函数为 chisq = sum((r / sigma) ** 2)。
残差的定义很好。我也会使用它,但我对一维西格玛感到困惑。
我的理解是(不确定是否正确):
一维 sigma 是 M 长度的序列。由于这里的 ydata 是长度为 M 的数组,因此 sigma (sigma[0]) 第一个位置的值是 ydata (ydata[0]) 第一个位置的值的误差的标准差。
现在的问题是,如果存在不对称误差,我应该使用 sigma[0] 什么呢?
我的意思是,如果 ydata[0] 有不对称误差(例如 +0.2 和 -0.1),那么我应该计算 0.2 和 -0.1 的标准差? 我是否理解正确,我直接得到的那些 yerrors 不应该在这里用作 sigma ?
I read the documentation of scipy.optimize.curve_fit, but sigma is still unclear for me.
I did understand what sigma is here used for, but I did not understand, how should I actually use it with asymmetric uncertainty.
Documentation: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html#scipy.optimize.curve_fit
Detailed description:
The documentation says:
If we define residuals as r = ydata - f(xdata, *popt), then the interpretation of sigma depends on its number of dimensions:
A 1-D sigma should contain values of standard deviations of errors in ydata. In this case, the optimized function is chisq = sum((r / sigma) ** 2).
The definition of residual is fine. I will use it too, but I am confused with the 1-D sigma.
What I understood is (not sure if it is correct):
A 1-D sigma is a M-length sequence. Since the ydata here is a length M array, the value in the first position from sigma (sigma[0]) is the standard deviation for the errors of the value in the first position from ydata (ydata[0]).
Now, the question is, what should I use for sigma[0] if I have asymmetric errors?
I mean, if I have asymmetric errors by ydata[0] (e.g. +0.2 and -0.1), then I should calculate the standard deviation from 0.2 and -0.1?
Did I understand correctly, that those yerrors I got directly, should not be used as sigma here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论