
    \hU                        S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr  S SKJrJr  S SKJrJrJrJrJrJrJrJrJr  S S	KJrJrJrJrJrJrJ r   S S
K!J"r"   " S S\5      r#S r$ " S S5      r% " S S5      r& " S S5      r'\%\'\'\&S.r( " S S\ \5      r) " S S\)5      r*S r+ " S S\)5      r,S r- " S S\)5      r.S r/ " S  S!\)5      r0S" r1g#)$    )prod)Basic)pi)S)exp)
multigamma)sympify_sympify)	ImmutableMatrixInverseTraceDeterminantMatrixSymbol
MatrixBase	Transpose	MatrixSetmatrix2numpy)_value_checkRandomMatrixSymbolNamedArgsMixinPSpace_symbol_converterMatrixDomainDistribution)import_modulec                       \ rS rSrSrS r\" S 5      r\" S 5      r\S 5       r	\S 5       r
\S 5       rS	 rSS jrS
rg)MatrixPSpace   z8
Represents probability space for
Matrix Distributions.
c                     [        U5      n[        U5      [        U5      pCUR                  (       a  UR                  (       d  [        S5      e[        R
                  " XX#U5      $ )NzDimensions should be integers)r   r
   
is_integer
ValueErrorr   __new__)clssymdistributiondim_ndim_ms        X/var/www/auris/envauris/lib/python3.13/site-packages/sympy/stats/matrix_distributions.pyr"   MatrixPSpace.__new__   sK    $u  U%5%5<==}}S|EBB    c                      U R                   S   $ )N   argsselfs    r(   <lambda>MatrixPSpace.<lambda>    s    1r*   c                      U R                   S   $ Nr   r-   r/   s    r(   r1   r2   !   s    499Q<r*   c                 V    [        U R                  U R                  R                  5      $ N)r   symbolr%   setr/   s    r(   domainMatrixPSpace.domain#   s    DKK):):)>)>??r*   c                 f    [        U R                  U R                  S   U R                  S   U 5      $ )N      )r   r7   r.   r/   s    r(   valueMatrixPSpace.value'   s'    !$++tyy|TYYq\4PPr*   c                     U R                   1$ r6   )r>   r/   s    r(   valuesMatrixPSpace.values+   s    

|r*   c                     UR                  [        5      n[        U5      S:  d  [        U[        5      (       d  [	        S5      eU R
                  R                  U5      $ )Nr,   ztCurrently, no algorithm has been implemented to handle general expressions containing multiple matrix distributions.)atomsr   len
isinstanceNotImplementedErrorr%   pdf)r0   exprr.   rmss       r(   compute_densityMatrixPSpace.compute_density/   sT    jj+,s8a<
41C D D% '5 6 6   $$T**r*    Nc                 N    U R                   U R                  R                  XUS90$ )z]
Internal sample method

Returns dictionary mapping RandomMatrixSymbol to realization value.
)libraryseed)r>   r%   sample)r0   sizerO   rP   s       r(   rQ   MatrixPSpace.sample7   s*     

D--44TQU4VWWr*   rM   scipyN)__name__
__module____qualname____firstlineno____doc__r"   propertyr%   r7   r9   r>   rA   rK   rQ   __static_attributes__rM   r*   r(   r   r      sn    C 56L/0F@ @ Q Q  +Xr*   r   c                     [        [        [        U5      5      nU" U6 nUR                  " U6   UR                  n[        XUS   US   5      nUR                  $ )Nr   r,   )listmapr	   check	dimensionr   r>   )r7   r#   r.   distdimpspaces         r(   rvre   @   sQ    GT"#D:DJJ
..C&AA7F<<r*   c                   2    \ rS rSrSrSS jr\S 5       rSrg)SampleMatrixScipyI   z7Returns the sample from scipy of the given distributionNc                 &    U R                  XU5      $ r6   )_sample_scipyr#   rb   rR   rP   s       r(   r"   SampleMatrixScipy.__new__K         T22r*   c                   ^
 SSK Jm
  SSKnU
4S jU
4S jS.nS S S.nUR                  5       nUR                  R
                  U;  a  gUb  [        U[        5      (       a  UR                  R                  US	9nOUnXQR                  R
                     " U[        U5      U5      n	U	R                  X&UR                  R
                     " U5      -   5      $ )
zSample from SciPy.r   )statsNc                    > TR                   R                  [        U R                  5      [	        U R
                  [        5      US9$ )N)dfscalerR   )wishartrvsintnr   scale_matrixfloatrb   rR   
rand_statescipy_statss      r(   r1   1SampleMatrixScipy._sample_scipy.<locals>.<lambda>U   s<    +BUBUBYBYtvv;l43D3De&LSW CZ CYr*   c                    > TR                   R                  [        U R                  [        5      [        U R
                  [        5      [        U R                  [        5      XS9$ )N)meanrowcovcolcovrR   random_state)matrix_normalrt   r   location_matrixrx   scale_matrix_1scale_matrix_2ry   s      r(   r1   r|   W   sQ    {G`G`GdGd!$"6"6>#D$7$7?#D$7$7?d He Her*   WishartDistributionMatrixNormalDistributionc                 .    U R                   R                  $ r6   rw   shaperb   s    r(   r1   r|   ^       0A0A0G0Gr*   c                 .    U R                   R                  $ r6   r   r   r   s    r(   r1   r|   _       d6J6J6P6Pr*   rP   )rU   ro   numpykeys	__class__rV   rF   ru   randomdefault_rngr   reshape)r#   rb   rR   rP   r   scipy_rv_mapsample_shape	dist_listrz   sampr{   s             @r(   rj   SampleMatrixScipy._sample_scipyN   s     	/$Y)e
 $H)P

 !%%'	>>"")3<:dC0011t1<JJNN334T4:zR||D0G0G#H#NNOOr*   rM   r6   )	rV   rW   rX   rY   rZ   r"   classmethodrj   r\   rM   r*   r(   rg   rg   I   s     A3 P Pr*   rg   c                   2    \ rS rSrSrSS jr\S 5       rSrg)SampleMatrixNumpyo   z7Returns the sample from numpy of the given distributionNc                 &    U R                  XU5      $ r6   )_sample_numpyrk   s       r(   r"   SampleMatrixNumpy.__new__s   rm   r*   c                    0 n0 nUR                  5       nUR                  R                  U;  a  gSSKnUb  [	        U[
        5      (       a  UR                  R                  US9nOUnXAR                  R                     " U[        U5      U5      n	U	R                  X%UR                  R                     " U5      -   5      $ )zSample from NumPy.Nr   r   )
r   r   rV   r   rF   ru   r   r   r   r   )
r#   rb   rR   rP   numpy_rv_mapr   r   r   rz   r   s
             r(   r   SampleMatrixNumpy._sample_numpyv   s    

 !%%'	>>"")3<:dC0011t1<JJNN334T4:zR||D0G0G#H#NNOOr*   rM   r6   )	rV   rW   rX   rY   rZ   r"   r   r   r\   rM   r*   r(   r   r   o   s     A3 P Pr*   r   c                   2    \ rS rSrSrSS jr\S 5       rSrg)SampleMatrixPymc   z6Returns the sample from pymc of the given distributionNc                 &    U R                  XU5      $ r6   )_sample_pymcrk   s       r(   r"   SampleMatrixPymc.__new__   s    D11r*   c           
      B  ^	  SSK m	U	4S jU	4S jS.nS S S.nUR                  5       nUR                  R
                  U;  a  gSSKnUR                  S	5      R                  UR                  5        T	R                  5          XAR                  R
                     " U5        T	R                  [        U5      S
SUSSS9S   nSSS5        WR                  X%UR                  R
                     " U5      -   5      $ ! [         a    SSKm	 GNf = f! , (       d  f       NS= f)zSample from PyMC.r   Nc           	         > TR                  S[        U R                  [        5      [        U R                  [        5      [        U R
                  [        5      U R                  R                  S9$ )NX)mur   r   r   )MatrixNormalr   r   rx   r   r   r   rb   pymcs    r(   r1   /SampleMatrixPymc._sample_pymc.<locals>.<lambda>   sW    T5F5Fs 4 4e<#D$7$7?#D$7$7?**00	 6G 62r*   c                 |   > TR                  S[        U R                  5      [        U R                  [
        5      S9$ )Nr   )nur   )WishartBartlettru   rv   r   rw   rx   r   s    r(   r1   r      s3    0D0DStvv;,t/@/@%"H 1E 1Jr*   )r   r   c                 .    U R                   R                  $ r6   r   r   s    r(   r1   r      r   r*   c                 .    U R                   R                  $ r6   r   r   s    r(   r1   r      r   r*   r   r   r,   F)drawschainsprogressbarrandom_seedreturn_inferencedatacompute_convergence_checksr   )r   ImportErrorpymc3r   r   rV   logging	getLoggersetLevelERRORModelrQ   r   r   )
r#   rb   rR   rP   pymc_rv_mapr   r   r   sampsr   s
            @r(   r   SampleMatrixPymc._sample_pymc   s   	!)2
$J
 $H)P

  $$&	>>"")3&!**7==9ZZ\//06KKd4j[_v{  Y^K  _  `c  dE  }}T1H1H$I$$OOPP5  	! 	!. \s   C; ?D;DD
DrM   r6   )	rV   rW   rX   rY   rZ   r"   r   r   r\   rM   r*   r(   r   r      s     @2 Q Qr*   r   )rU   r   r   r   c                   >    \ rS rSrSrS r\S 5       rS rS	S jr	Sr
g)
MatrixDistribution   z)
Abstract class for Matrix Distribution.
c                     U Vs/ s H.  n[        U[        5      (       a  [        U5      O
[        U5      PM0     nn[        R
                  " U /UQ76 $ s  snf r6   )rF   r^   r   r
   r   r"   )r#   r.   args      r(   r"   MatrixDistribution.__new__   sX    .24.2s )33(=(=$c]#.2 	 4}}S(4((4s   5Ac                      g r6   rM   r-   s    r(   r`   MatrixDistribution.check   s    r*   c                 d    [        U[        5      (       a  [        U5      nU R                  U5      $ r6   )rF   r^   r   rH   )r0   rI   s     r(   __call__MatrixDistribution.__call__   s'    dD!!"4(Dxx~r*   rM   Nc                     / SQnX$;  a  [        S[        U5      -  5      e[        U5      (       d  [        SU-  5      e[        U   " XU5      nUb  U$ [        SU R
                  R                  < SU< 35      e)zW
Internal sample method

Returns dictionary mapping RandomSymbol to realization value.
)rU   r   r   r   z&Sampling from %s is not supported yet.zFailed to import %szSampling for z# is not currently implemented from )rG   strr   r!   _get_sample_class_matrixrvr   rV   )r0   rR   rO   rP   	librariesr   s         r(   rQ   MatrixDistribution.sample   s     8	#%&N*-g,'7 8 8W%%2W<==*73DEL!>>**G5 	r*   rT   )rV   rW   rX   rY   rZ   r"   staticmethodr`   r   rQ   r\   rM   r*   r(   r   r      s*    )
  
r*   r   c                   N    \ rS rSrSr\S 5       r\S 5       r\S 5       r	S r
Srg)	MatrixGammaDistribution   alphabetarw   c                     [        U[        5      (       d  [        UR                  S5        [        UR                  S5        [        U R
                  S5        [        UR
                  S5        g )N+The shape matrix must be positive definite.Should be square matrix#Shape parameter should be positive.z#Scale parameter should be positive.rF   r   r   is_positive_definite	is_squareis_positiver   s      r(   r`   MatrixGammaDistribution.check   s[    ,55:: =4 5\++ . 	U&&(MNT%%'LMr*   c                 h    U R                   R                  S   n[        X[        R                  5      $ r4   rw   r   r   r   Realsr0   ks     r(   r8   MatrixGammaDistribution.set   )    ##A&qww''r*   c                 .    U R                   R                  $ r6   r   r/   s    r(   ra   !MatrixGammaDistribution.dimension        &&&r*   c                    U R                   U R                  U R                  pCnUR                  S   n[	        U[
        5      (       a  [        U5      n[	        U[        [        45      (       d  [        S[        U5      -  5      e[        U5      * U-  U-  n[        [        U5      5      X5U-  -  [        X%5      -  -  n[        U5      U* -  n[        U5      U[!        US-   5      S-  -
  -  n	Xx-  U	-  $ )Nr   4%s should be an isinstance of Matrix or MatrixSymbolr,   r<   )r   r   rw   r   rF   r^   r   r   r   r!   r   r   r   r   r   r   r   )
r0   xr   r   rw   psigma_inv_xterm1term2term3s
             r(   rH   MatrixGammaDistribution.pdf  s    $(JJ		4;L;L\q!a"A!j,788 &(+A/ 0 0--a/$6E+&'$5/Z=Q)QR\*uf5Q51QU8A:#56}u$$r*   rM   NrV   rW   rX   rY   	_argnamesr   r`   r[   r8   ra   rH   r\   rM   r*   r(   r   r      sH    1IN N ( ( ' '%r*   r   c                 h    [        U[        5      (       a  [        U5      n[        U [        XU45      $ )a  
Creates a random variable with Matrix Gamma Distribution.

The density of the said distribution can be found at [1].

Parameters
==========

alpha: Positive Real number
    Shape Parameter
beta: Positive Real number
    Scale Parameter
scale_matrix: Positive definite real square matrix
    Scale Matrix

Returns
=======

RandomSymbol

Examples
========

>>> from sympy.stats import density, MatrixGamma
>>> from sympy import MatrixSymbol, symbols
>>> a, b = symbols('a b', positive=True)
>>> M = MatrixGamma('M', a, b, [[2, 1], [1, 2]])
>>> X = MatrixSymbol('X', 2, 2)
>>> density(M)(X).doit()
exp(Trace(Matrix([
[-2/3,  1/3],
[ 1/3, -2/3]])*X)/b)*Determinant(X)**(a - 3/2)/(3**a*sqrt(pi)*b**(2*a)*gamma(a)*gamma(a - 1/2))
>>> density(M)([[1, 0], [0, 1]]).doit()
exp(-4/(3*b))/(3**a*sqrt(pi)*b**(2*a)*gamma(a)*gamma(a - 1/2))


References
==========

.. [1] https://en.wikipedia.org/wiki/Matrix_gamma_distribution

)rF   r^   r   re   r   )r7   r   r   rw   s       r(   MatrixGammar     s1    V ,%%&|4f-\/JKKr*   c                   N    \ rS rSrSr\S 5       r\S 5       r\S 5       r	S r
Srg)	r   iH  rv   rw   c                     [        U[        5      (       d  [        UR                  S5        [        UR                  S5        [        U R
                  S5        g )Nr   r   r   r   r  s     r(   r`   WishartDistribution.checkL  sH    ,55:: =4 5\++ . 	Q]]$IJr*   c                 h    U R                   R                  S   n[        X[        R                  5      $ r4   r   r   s     r(   r8   WishartDistribution.setU  r   r*   c                 .    U R                   R                  $ r6   r   r/   s    r(   ra   WishartDistribution.dimensionZ  r   r*   c                 ,   U R                   U R                  p2UR                  S   n[        U[        5      (       a  [        U5      n[        U[        [        45      (       d  [        S[        U5      -  5      e[        U5      * U-  [        S5      -  n[        [        U5      5      SXB-  [        S5      -  -  [        U[        S5      -  U5      -  -  n[        U5      U* [        S5      -  -  n[        U5      [        X$-
  S-
  5      S-  -  nXg-  U-  $ )Nr   r   r<   r,   )rv   rw   r   rF   r^   r   r   r   r!   r   r   r   r   r   r   r   )	r0   r   rv   rw   r   r   r   r   r   s	            r(   rH   WishartDistribution.pdf^  s    &&$"3"3<q!a"A!j,788 &(+A/ 0 0--a/!A$6E+&'!ac!A$h-:a!fa;P)PQ\*qb1g6Q1QUQY<>2}u$$r*   rM   Nr   rM   r*   r(   r   r   H  sH    %IK K ( ( ' '%r*   r   c                 f    [        U[        5      (       a  [        U5      n[        U [        X45      $ )aY  
Creates a random variable with Wishart Distribution.

The density of the said distribution can be found at [1].

Parameters
==========

n: Positive Real number
    Represents degrees of freedom
scale_matrix: Positive definite real square matrix
    Scale Matrix

Returns
=======

RandomSymbol

Examples
========

>>> from sympy.stats import density, Wishart
>>> from sympy import MatrixSymbol, symbols
>>> n = symbols('n', positive=True)
>>> W = Wishart('W', n, [[2, 1], [1, 2]])
>>> X = MatrixSymbol('X', 2, 2)
>>> density(W)(X).doit()
exp(Trace(Matrix([
[-1/3,  1/6],
[ 1/6, -1/3]])*X))*Determinant(X)**(n/2 - 3/2)/(2**n*3**(n/2)*sqrt(pi)*gamma(n/2)*gamma(n/2 - 1/2))
>>> density(W)([[1, 0], [0, 1]]).doit()
exp(-2/3)/(2**n*3**(n/2)*sqrt(pi)*gamma(n/2)*gamma(n/2 - 1/2))

References
==========

.. [1] https://en.wikipedia.org/wiki/Wishart_distribution

)rF   r^   r   re   r   )r7   rv   rw   s      r(   Wishartr  l  s/    P ,%%&|4f)A+<==r*   c                   N    \ rS rSrSr\S 5       r\S 5       r\S 5       r	S r
Srg)	r   i  )r   r   r   c           	         [        U[        5      (       d  [        UR                  S5        [        U[        5      (       d  [        UR                  S5        [        UR                  S5        [        UR                  S5        U R
                  S   nU R
                  S   n[        UR
                  S   U:H  S[        U5      < S[        U5      < 35        [        UR
                  S   U:H  S[        U5      < S[        U5      < 35        g )	Nr   )Scale matrix 1 should be be square matrix)Scale matrix 2 should be be square matrixr   r,   "Scale matrix 1 should be of shape  x "Scale matrix 2 should be of shape )rF   r   r   r   r   r   r   )r   r   r   rv   r   s        r(   r`   MatrixNormalDistribution.check  s    .,77<< ?4 5.,77<< ?4 5^-- 0 	^-- 0 	!!!$!!!$^))!,1!!fc!f4. 	/^))!,1!!fc!f4. 	/r*   c                 f    U R                   R                  u  p[        X[        R                  5      $ r6   r   r   r   r   r   r0   rv   r   s      r(   r8   MatrixNormalDistribution.set  &    ##))qww''r*   c                 .    U R                   R                  $ r6   r   r/   s    r(   ra   "MatrixNormalDistribution.dimension      ##)))r*   c                 F   U R                   U R                  U R                  pCnUR                  u  pV[	        U[
        5      (       a  [        U5      n[	        U[        [        45      (       d  [        S[        U5      -  5      e[        U5      [        X-
  5      -  [        U5      -  X-
  -  n[        [        U5      * [        S5      -  5      nS[         -  [        XV-  5      S-  -  [#        U5      [        U5      S-  -  -  [#        U5      [        U5      S-  -  -  n	X-  $ )Nr   r<   )r   r   r   r   rF   r^   r   r   r   r!   r   r   r   r   r   r   r   r   )
r0   r   MUVrv   r   r   numdens
             r(   rH   MatrixNormalDistribution.pdf  s    &&(;(;T=P=Pawwa"A!j,788 &(+A/ 0 0
9QU++GAJ6>5<-!$%tqvax ;q>AaDF#;;k!nqQRtTUv>VVwr*   rM   Nr   rM   r*   r(   r   r     sF    GI/ /$ ( ( * *r*   r   c                     [        U[        5      (       a  [        U5      n[        U[        5      (       a  [        U5      n[        U[        5      (       a  [        U5      nXU4n[        U [        U5      $ )aC  
Creates a random variable with Matrix Normal Distribution.

The density of the said distribution can be found at [1].

Parameters
==========

location_matrix: Real ``n x p`` matrix
    Represents degrees of freedom
scale_matrix_1: Positive definite matrix
    Scale Matrix of shape ``n x n``
scale_matrix_2: Positive definite matrix
    Scale Matrix of shape ``p x p``

Returns
=======

RandomSymbol

Examples
========

>>> from sympy import MatrixSymbol
>>> from sympy.stats import density, MatrixNormal
>>> M = MatrixNormal('M', [[1, 2]], [1], [[1, 0], [0, 1]])
>>> X = MatrixSymbol('X', 1, 2)
>>> density(M)(X).doit()
exp(-Trace((Matrix([
[-1],
[-2]]) + X.T)*(Matrix([[-1, -2]]) + X))/2)/(2*pi)
>>> density(M)([[3, 4]]).doit()
exp(-4)/(2*pi)

References
==========

.. [1] https://en.wikipedia.org/wiki/Matrix_normal_distribution

)rF   r^   r   re   r   )r7   r   r   r   r.   s        r(   r   r     sd    R /4(()/:.$''(8.$''(8^<Df.55r*   c                   N    \ rS rSrSr\S 5       r\S 5       r\S 5       r	S r
Srg)	MatrixStudentTDistributioni  )r   r   r   r   c           	      f   [        U[        5      (       d  [        UR                  S:g  S5        [        U[        5      (       d  [        UR                  S:g  S5        [        UR                  S:g  S5        [        UR                  S:g  S5        UR
                  S   nUR
                  S   n[        UR
                  S   U:H  S[        U5      < S[        U5      < 35        [        UR
                  S   U:H  S	[        U5      < S[        U5      < 35        [        U R                  S:g  S
5        g )NFr   r  r  r   r,   r  r  r  z#Degrees of freedom must be positive)rF   r   r   r   r   r   r   r   )r   r   r   r   rv   r   s         r(   r`    MatrixStudentTDistribution.check  s$   .,77<<E Hb c.,77<<E Hb c^--6 9B 	C^--6 9B 	C!!!$!!!$^))!,1JMa&RUVWRX4Z 	[^))!,1JMa&RUVWRX4Z 	[R^^u,.STr*   c                 f    U R                   R                  u  p[        X[        R                  5      $ r6   r  r  s      r(   r8   MatrixStudentTDistribution.set  r  r*   c                 .    U R                   R                  $ r6   r   r/   s    r(   ra   $MatrixStudentTDistribution.dimension  r  r*   c           	         SSK Jn  [        U[        5      (       a  [	        U5      n[        U[
        [        45      (       d  [        S[        U5      -  5      eU R                  U R                  U R                  U R                  4u  p4pVUR                  u  px[        X7-   U-   S-
  S-  U5      [        U5      U* S-  -  -  [        U5      U* S-  -  -  [         Xx-  S-  -  [        X8-   S-
  S-  U5      -  -  n	U	[        U" U5      [#        U5      X-
  -  [#        U5      -  [%        X-
  5      -  -   5      X7-   U-   S-
  * S-  -  -  $ )Nr   )eyer   r,   r<   )sympy.matrices.denser.  rF   r^   r   r   r   r!   r   r   r   r   r   r   r   r   r   r   r   )
r0   r   r.  r   r  OmegaSigmarv   r   Ks
             r(   rH   MatrixStudentTDistribution.pdf  sL   ,a"A!j,788 /14Q8 9 9"ggt';';T=P=PRVReReeuww
Q)1-E0BaRT0JJ[Y^M_cdbdefbfMggac!e}z26A:q.!<<>KA)?)NyYZY^O_)_ _`FQJM"1$& & 	&r*   rM   Nr   rM   r*   r(   r&  r&    sH    MIU U& ( ( * *&r*   r&  c                     [        U[        5      (       a  [        U5      n[        U[        5      (       a  [        U5      n[        U[        5      (       a  [        U5      nXX44n[        U [        U5      $ )a  
Creates a random variable with Matrix Gamma Distribution.

The density of the said distribution can be found at [1].

Parameters
==========

nu: Positive Real number
    degrees of freedom
location_matrix: Positive definite real square matrix
    Location Matrix of shape ``n x p``
scale_matrix_1: Positive definite real square matrix
    Scale Matrix of shape ``p x p``
scale_matrix_2: Positive definite real square matrix
    Scale Matrix of shape ``n x n``

Returns
=======

RandomSymbol

Examples
========

>>> from sympy import MatrixSymbol,symbols
>>> from sympy.stats import density, MatrixStudentT
>>> v = symbols('v',positive=True)
>>> M = MatrixStudentT('M', v, [[1, 2]], [[1, 0], [0, 1]], [1])
>>> X = MatrixSymbol('X', 1, 2)
>>> density(M)(X)
gamma(v/2 + 1)*Determinant((Matrix([[-1, -2]]) + X)*(Matrix([
[-1],
[-2]]) + X.T) + Matrix([[1]]))**(-v/2 - 1)/(pi**1.0*gamma(v/2)*Determinant(Matrix([[1]]))**1.0*Determinant(Matrix([
[1, 0],
[0, 1]]))**0.5)

References
==========

.. [1] https://en.wikipedia.org/wiki/Matrix_t-distribution

)rF   r^   r   re   r&  )r7   r   r   r   r   r.   s         r(   MatrixStudentTr5  /  sd    X /4(()/:.$''(8.$''(8@Df0$77r*   N)2mathr   sympy.core.basicr   sympy.core.numbersr   sympy.core.singletonr   &sympy.functions.elementary.exponentialr   'sympy.functions.special.gamma_functionsr   sympy.core.sympifyr	   r
   sympy.matricesr   r   r   r   r   r   r   r   r   sympy.stats.rvr   r   r   r   r   r   r   sympy.externalr   r   re   rg   r   r   r   r   r   r   r   r  r   r   r&  r5  rM   r*   r(   <module>r@     s     " ! " 6 > 0* * *K K K ()X6 )XX#P #PLP P>&Q &QR 	 '~ '`#%0 #%J-Ld"%, "%H*>^+1 +Z06j.&!3 .&d38r*   