借助sympy.stats.LogLogistic()
方法,我们可以获得代表Log-Logistic分布的连续随机变量。
用法:sympy.stats.LogLogistic(name, alpha, beta)
Where, alpha and beta are real number and alpha, beta > 0.
返回: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
相关用法
注:本文由纯净天空筛选整理自Jitender_1998大神的英文原创作品 sympy.stats.LogLogistic() in python。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。