📜  Python中的 sympy.stats.Benini()

📅  最后修改于: 2022-05-13 01:55:22.655000             🧑  作者: Mango

Python中的 sympy.stats.Benini()

借助sympy.stats.Benini()方法,我们可以得到代表贝尼尼分布的连续随机变量。

示例 #1:

在这个例子中,我们可以看到,通过使用 sympy.stats.Benini() 方法,我们可以得到表示贝尼尼分布的连续随机变量。

Python3
# Import sympy and Benini
from sympy.stats import Benini, density, cdf
from sympy import Symbol, simplify, pprint
 
alpha = Symbol("alpha", positive = True)
beta = Symbol("beta", positive = True)
sigma = Symbol("sigma", positive = True)
z = Symbol("z")
 
# Using sympy.stats.Benini() method
X = Benini("x", alpha, beta, sigma)
GFG = density(X)(z)
 
pprint(GFG, use_unicode = False)


Python3
# Import sympy and Benini
from sympy.stats import Benini, density, cdf
from sympy import Symbol, simplify, pprint
 
alpha = 4
beta = 6
sigma = 3
z = 0.2
 
# Using sympy.stats.Benini() method
X = Benini("x", alpha, beta, sigma)
GFG = density(X)(z)
 
pprint(GFG, use_unicode = False)


输出 :

示例 #2:

Python3

# Import sympy and Benini
from sympy.stats import Benini, density, cdf
from sympy import Symbol, simplify, pprint
 
alpha = 4
beta = 6
sigma = 3
z = 0.2
 
# Using sympy.stats.Benini() method
X = Benini("x", alpha, beta, sigma)
GFG = density(X)(z)
 
pprint(GFG, use_unicode = False)

输出 :