[英]Burr distribution in scipy.stats
I am trying to calculate the mean and std for burr distribution, but I am not quite sure how to input this.我正在尝试计算毛刺分布的均值和标准差,但我不太确定如何输入。 The pdf I am using is:
f(x) = (alpha*gamma*lambda**alpha*x**(gamma-1))/(lambda+x**gamma)**(alpha+1)
from the IFoA Formulae.我使用的pdf是:来自IFoA的
f(x) = (alpha*gamma*lambda**alpha*x**(gamma-1))/(lambda+x**gamma)**(alpha+1)
方程式。
I have calculated the parameters to be: alpha = 2.3361635751273977, lambda = 10.596809948869414 and gamma = 0.5 in order to get mean = 500 and std = 600.我计算的参数为:alpha = 2.3361635751273977,lambda = 10.596809948869414 和 gamma = 0.5,以获得均值 = 500 和 std = 600。
Could someone suggest how I should input the data into scipy.stats.burr
or scipy.stats.burr12
?有人可以建议我应该如何将数据输入
scipy.stats.burr
或scipy.stats.burr12
吗?
You need burr12
here, not burr
.你在这里需要
burr12
,而不是burr
。 (The difference is in the sign of the power of x that sits inside another power. Confusingly, it's burr12
that is usually called simply Burr outside of SciPy, not the thing that SciPy calls burr
.) (不同之处在于位于另一个幂内部的 x 幂的符号。令人困惑的是,在 SciPy 之外通常简称为 Burr 的是
burr12
,而不是 SciPy 称为burr
的东西。)
The Burr XII PDF is written in SciPy as c*d*x**(c-1)*(1+x**c)**(-d-1)
where c, d are positive shape parameters. Burr XII PDF 在 SciPy 中编写为
c*d*x**(c-1)*(1+x**c)**(-d-1)
其中 c、d 是正形状参数。 Your formula你的公式
(alpha*gamma*lamda**alpha*x**(gamma-1)) / (lamda+x**gamma)**(alpha+1)
has lambda in place of 1, so there is some scaling involved.用 lambda 代替 1,因此涉及一些缩放。 SciPy docs say
SciPy 文档说
burr12.pdf(x, c, d, loc, scale)
is identically equivalent toburr12.pdf(y, c, d) / scale
withy = (x - loc) / scale
.burr12.pdf(x, c, d, loc, scale)
等同于burr12.pdf(y, c, d) / scale
y = (x - loc) / scale
。
So, in order for lamda+x**gamma
to be a constant multiple of 1 + (x/scale)**gamma
, we need scale
to be lamda**(1/gamma)
.因此,为了使
lamda+x**gamma
成为1 + (x/scale)**gamma
的常数倍,我们需要将scale
设为lamda**(1/gamma)
。 The exponents correspond to SciPy notation as c = gamma
and d = alpha
.指数对应于 SciPy 符号为
c = gamma
和d = alpha
。 Let's test this:让我们测试一下:
from scipy.stats import burr12
alpha = 2.3361635751273977
lamda = 10.596809948869414
gamma = 0.5
scale = lamda**(1/gamma)
c = gamma
d = alpha
print(burr12.mean(c, d, loc=0, scale=scale))
print(burr12.std(c, d, loc=0, scale=scale))
which prints哪个打印
500.0
600.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.