Python中的 sympy.stats.Kumaraswamy()
借助sympy.stats.Kumaraswamy()
方法,我们可以得到代表 kumaraswamy 分布的连续随机变量。
Syntax : sympy.stats.Kumaraswamy(name, a, b)
Where, a and b are real number and a, b > 0.
Return : Return the continuous random variable.
示例 #1:
在这个例子中我们可以看到,通过使用sympy.stats.Kumaraswamy()
方法,我们可以通过这个方法得到表示 kumaraswamy 分布的连续随机变量。
# Import sympy and Kumaraswamy
from sympy.stats import Kumaraswamy, density
from sympy import Symbol, pprint
z = Symbol("z")
a = Symbol("a", positive = True)
b = Symbol("b", positive = True)
# Using sympy.stats.Kumaraswamy() method
X = Kumaraswamy("x", a, b)
gfg = density(X)(z)
pprint(gfg)
输出 :
b – 1
a – 1 / a\
a*b*z *\1 – z /
示例 #2:
# Import sympy and Kumaraswamy
from sympy.stats import Kumaraswamy, density
from sympy import Symbol, pprint
z = 0.3
a = 2
b = 6
# Using sympy.stats.Kumaraswamy() method
X = Kumaraswamy("x", a, b)
gfg = density(X)(z)
pprint(gfg)
输出 :
2.24651572236000