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