scipy 分布为小于 loc(平均值)的值提供零

发布于 2025-01-15 12:22:26 字数 472 浏览 3 评论 0原文

对于产生以下直方图的数据,我使用了 gamma.fit(data) 函数。它产生 (0.2856629839547822, 0.001612367540316285, 1.3126526078419007),它必须是分布的 alpha、locscale 参数。但是,给定数据集的平均值和标准差分别为 m=0.04181341484525036s=0.02581912984507876。 PDF 为零,低于平均值 (m)。我找不到任何关于这个问题的问题。我缺少什么?

数据直方图
输入图片此处描述

For the data yielding the below histogram, I used gamma.fit(data) function. It yields (0.2856629839547822, 0.001612367540316285, 1.3126526078419007) which must be the alpha, loc, and scale parameters of the distribution. However, the mean and standard deviations are m=0.04181341484525036 and s=0.02581912984507876 for the given dataset. The PDF is zero below the mean (m) value. I couldn't find any questions about this problem. What am I missing?

Histogram of the data
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

追星践月 2025-01-22 12:22:26

对于低于计算平均值的所有值,PDF 绝对不为零。事实上,超过 40% 的 PDF 区域位于 x<=m

from scipy import stats

g = stats.gamma(0.2856629839547822, 0.001612367540316285, 1.3126526078419007)
m=0.04181341484525036

print(g.cdf(m))

0.4078

The PDF is most definitely not zero for all values below your calculated mean. I fact, over 40% of the PDF area resides at x<=m:

from scipy import stats

g = stats.gamma(0.2856629839547822, 0.001612367540316285, 1.3126526078419007)
m=0.04181341484525036

print(g.cdf(m))

0.4078
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文