如何使用scipy(python)计算gamma分布的熵?

2024-10-09 20:25:42 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试了saullocastro的sample code来获得伽马分布的参数,使用scipy。在

import scipy
import scipy.stats

size = 30000
x = scipy.arange(size)
y = scipy.int_(scipy.round_(scipy.stats.vonmises.rvs(5,size=size)*47))
dist = getattr(scipy.stats, 'gamma')
param = dist.fit(y)
dist.entropy(param)

给我熵的结果,这是没有意义的。我错在哪里了?在

^{pr2}$

在scipy文档中,它声明

entropy(a, loc=0, scale=1)  (Differential) entropy of the RV.

在哪里

a is the array of parameters of the gamma distribution

Tags: ofthesampleimport参数sizeparamdist

热门问题