sympy.stats.MultivariateBeta() function in Python
Last Updated :
18 Aug, 2020
With the help of sympy.stats.MultivariateBeta() method, we can create a continuous random variable with Dirichlet/Multivariate Beta Distribution.
It is a multivariate generalization of the beta distribution.
Syntax: sympy.stats.MultivariateBeta(syms, alpha)
Parameters:
syms: the symbol
alpha: positive real numbers signifying concentration numbers
Returns: a continuous random variable with multivariate beta distribution.
Example #1 :
Python3
from sympy.stats.joint_rv_types import MultivariateBeta
from sympy.stats import density
from sympy import Symbol, pprint
a = Symbol( 'a' , positive = True )
b = Symbol( 'b' , positive = True )
x = Symbol( 'x' )
y = Symbol( 'y' )
M = MultivariateBeta( 'M' , [a, b])
mvbDist = density(M)(x, y)
pprint(mvbDist)
|
Output :
a1 - 1 a2 - 1
x *y *Gamma(a1 + a2)
------------------------------
Gamma(a1)*Gamma(a2)
Example #2 :
Python3
from sympy.stats.joint_rv_types import MultivariateBeta
from sympy.stats import density
from sympy import Symbol, pprint
x = Symbol( 'x' )
y = Symbol( 'y' )
M = MultivariateBeta( 'M' , [ 2 , 1 / 2 ])
mvbDist = density(M)(x, y)
pprint(mvbDist)
|
Output :
3*x
-------
___
4*\/ y
Share your thoughts in the comments
Please Login to comment...