sympy.stats.MultivariateT() function in Python
With the help of sympy.stats.MultivariateT() method, we can create a joint random variable with multivariate T-distribution.
Syntax: sympy.stats.MultivariateT(syms, mu, sigma, v)
Parameters:
syms: the symbol for identifying the random variable
mu: a matrix representing the location vector
sigma: The shape matrix for the distribution
v: a real number
Returns: a joint random variable with multivariate T-distribution.
Example #1 :
Python3
from sympy.stats import density, MultivariateT
from sympy import Symbol, pprint
x = Symbol( "x" )
X = MultivariateT( "x" , [ 1 , 1 ], [[ 1 , 0 ], [ 0 , 1 ]], 2 )
multiVar = density(X)( 1 , 2 )
pprint(multiVar)
|
Output :
2
----
9*pi
Example #2 :
Python3
from sympy.stats import density, MultivariateT
from sympy import Symbol, pprint
x = Symbol( "x" )
X = MultivariateT( "x" , [ 1 , 1 , 1 ], [[ 1 , 0 , 1 ], [ 0 , 1 , 0 ], [ 0 , 0 , 1 ]], 1 / 2 )
multiVar = density(X)( 1 , 2 , 3 )
pprint(multiVar)
|
Output :
4 ____ ___
2*\/ 11 *\/ 2 *Gamma(7/4)
-------------------------
3/2
121*pi *Gamma(1/4)
Last Updated :
18 Aug, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...