借助sympy.stats.Logistic()
方法,我們可以獲得代表邏輯分布的連續隨機變量。
用法:sympy.stats.Logistic(name, mu, s)
Where, mu and s are real number and mu, s > 0.
返回:Return the continuous random variable.
範例1:
在這個例子中,我們可以通過使用sympy.stats.Logistic()
通過這種方法,我們能夠得到代表邏輯分布的連續隨機變量。
# Import sympy and Logistic
from sympy.stats import Logistic, density
from sympy import Symbol, pprint
z = Symbol("z")
mu = Symbol("mu", positive = True)
s = Symbol("s", positive = True)
# Using sympy.stats.Logistic() method
X = Logistic("x", mu, s)
gfg = density(X)(z)
pprint(gfg)
輸出:
mu - z
——
s
e
—————-
2
/ mu - z \
| —— |
| s |
s*\e + 1/
範例2:
# Import sympy and Logistic
from sympy.stats import Logistic, density
from sympy import Symbol, pprint
z = 0.3
mu = 5
s = 1.3
# Using sympy.stats.Logistic() method
X = Logistic("x", mu, s)
gfg = density(X)(z)
pprint(gfg)
輸出:
0.0196269669241977
相關用法
注:本文由純淨天空篩選整理自Jitender_1998大神的英文原創作品 sympy.stats.Logistic() in python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。