借助sympy.stats.GeneralizedMultivariateLogGamma()方法,我們可以獲得連續的聯合隨機變量,它代表了廣義多元對數伽馬分布。
用法:GeneralizedMultivariateLogGamma(syms, delta, v, lamda, mu)
參數:
1) Syms - list of symbols
2) Delta - a constant in range [0, 1]
3) V - positive real number
4) Lambda - a list of positive reals
5) mu - a list of positive real numbers.
返回:Return the continuous joint random variable.
範例1:
在這個例子中,我們可以通過使用sympy.stats.GeneralizedMultivariateLogGamma()該方法可以得到代表廣義多元對數伽馬分布的連續聯合隨機變量。
# Import sympy and GeneralizedMultivariateLogGamma
from sympy.stats import density
from sympy.stats.joint_rv_types import GeneralizedMultivariateLogGamma
from sympy.stats.joint_rv import marginal_distribution
from sympy import symbols, S
v = 1
l, mu = [1, 1, 1], [1, 1, 1]
d = S.Half
y = symbols('y_1:4', positive = True)
# Using sympy.stats.GeneralizedMultivariateLogGamma() method
Gd = GeneralizedMultivariateLogGamma('G', d, v, l, mu)
gfg = density(Gd)(y[0], y[1], y[2])
pprint(gfg)輸出:
oo
_____
\ `
\ y_1 y_2 y_3
\ -n (n + 1)*(y_1 + y_2 + y_3) - e - e - e
\ 2 *e
/ ---------------------------------------------------
/ 3
/ Gamma (n + 1)
/____,
n = 0
----------------------------------------------------------
2
範例2:
# Import sympy and GeneralizedMultivariateLogGamma
from sympy.stats import density
from sympy.stats.joint_rv_types import GeneralizedMultivariateLogGamma
from sympy.stats.joint_rv import marginal_distribution
from sympy import symbols, S
v = 1
l, mu = [1, 2, 3], [2, 5, 1]
d = S.One
y = symbols('y_1:4', positive = True)
# Using sympy.stats.GeneralizedMultivariateLogGamma() method
Gd = GeneralizedMultivariateLogGamma('G', d, v, l, mu)
gfg = density(Gd)(y[0], y[1], y[2])
pprint(gfg)輸出:
oo
______
\ `
\ 5*y_2 y_3
\ 2*y_1 e e
\ (n + 1)*(2*y_1 + 5*y_2 + y_3) - e - ------ - ----
\ n -n - 1 2 3
/ 10*0 *6 *e
/ ---------------------------------------------------------------------
/ 3
/ Gamma (n + 1)
/_____,
n = 0
相關用法
- Python sympy.sin()用法及代碼示例
- Python sympy.nT()用法及代碼示例
- Python sympy.Add()用法及代碼示例
- Python sympy RGS用法及代碼示例
- Python sympy.ff()用法及代碼示例
- Python sympy.tan()用法及代碼示例
- Python sympy.apart()用法及代碼示例
- Python sympy.nC()用法及代碼示例
- Python sympy.nP()用法及代碼示例
- Python sympy.Mul()用法及代碼示例
- Python sympy.S()用法及代碼示例
- Python sympy.rf()用法及代碼示例
- Python sympy.eye()用法及代碼示例
- Python sympy.csc()用法及代碼示例
- Python sympy.Pow()用法及代碼示例
- Python sympy.gcd()用法及代碼示例
- Python sympy.cot()用法及代碼示例
- Python sympy.sec()用法及代碼示例
- Python sympy.cos()用法及代碼示例
- Python sympy.ones()用法及代碼示例
注:本文由純淨天空篩選整理自Jitender_1998大神的英文原創作品 Sympy stats.GeneralizedMultivariateLogGamma() in Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
