借助於sympy.stats.MultivariateEwens()方法,我們可以創建具有Multivariate Ewens Distribution的離散隨機變量。
用法:sympy.stats.MultivariateEwens(syms, n, theta) 參數: syms:the symbol n:size of the sample or the integer whose partitions are considered, a positive integer theta:mutation rate, must be positive real number 返回:a discrete random variable with Multivariate Ewens Distribution.
範例1:
Python3
# import sympy, MultivariateEwens, density, Symbol
from sympy.stats.joint_rv_types import MultivariateEwens
from sympy.stats import density
from sympy import Symbol, pprint
a = Symbol('a', positive = True)
b = Symbol('b', positive = True)
# using sympy.stats.MultivariateEwens() method
E = MultivariateEwens('E', 2, 1)
mveDist = density(E)(a, b)
pprint(mveDist)
輸出:
/ -a2 | 2 |------- for a1 + 2*a2 = 2 <a1!*a2! | | 0 otherwise \
範例2:
Python3
# import sympy, MultivariateEwens, density, Symbol
from sympy.stats.joint_rv_types import MultivariateEwens
from sympy.stats import density
from sympy import Symbol, pprint
a = Symbol('a', positive = True)
b = Symbol('b', positive = True)
# using sympy.stats.MultivariateEwens() method
E = MultivariateEwens('E', 2, 1 / 2)
mveDist = density(E)(a, b)
pprint(mveDist)
輸出:
/ -a1 -2*a2 |8*2 *2 |------------- for a1 + 2*a2 = 2 < 3*a1!*a2! | | 0 otherwise \
相關用法
- Python sympy.Function()用法及代碼示例
- Python sympy.stats.Die()用法及代碼示例
- Python sympy.stats.Binomial()用法及代碼示例
- Python sympy.stats.Skellam()用法及代碼示例
- Python sympy.stats.NormalGamma()用法及代碼示例
- Python sympy.stats.variance()用法及代碼示例
- Python sympy.stats.Gamma()用法及代碼示例
- Python sympy.stats.NegativeMultinomial()用法及代碼示例
- Python sympy.stats.MultivariateT()用法及代碼示例
- Python sympy.stats.MultivariateBeta()用法及代碼示例
- Python sympy.stats.Rademacher()用法及代碼示例
- Python sympy.stats.FiniteRV()用法及代碼示例
- Python sympy.stats.Hypergeometric()用法及代碼示例
- Python sympy.stats.Multinomial()用法及代碼示例
- Python sympy.stats.BetaBinomial()用法及代碼示例
- Python sympy RGS用法及代碼示例
- Python sympy.div()用法及代碼示例
- Python Sympy Permutation.max()用法及代碼示例
- Python Sympy Permutation.min()用法及代碼示例
- Python sympy.sec()用法及代碼示例
注:本文由純淨天空篩選整理自ravikishor大神的英文原創作品 sympy.stats.MultivariateEwens() function in Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。