({{, (RefLink[MatrixTDistribution, paclet:ref/MatrixTDistribution])[(Subscript[Σ, row]),(Subscript[Σ, col]),ν] 
represents zero mean matrix t distribution with row covariance matrix (Subscript[Σ, row]), column covariance matrix (Subscript[Σ, col]), and degrees of freedom parameter ν.}, {, (RefLink[MatrixTDistribution, paclet:ref/MatrixTDistribution])[μ,(Subscript[Σ, row]),(Subscript[Σ, col]),ν]
represents matrix t distribution with mean matrix μ.}})

OpenersNotesSection(Spacer1)Details

The probability density for a matrix x of dimensions {n,m} in a matrix t distribution is proportional to ((det[(Subscript[I, n])+(Overscript[(Subscript[Σ, row]), -1]).(x-μ).(Overscript[(Subscript[Σ, col]), -1]).(((x-μ))^ᵀ)])^(-(ν+n+m-1)/2)) with (Subscript[I, n]) an identity matrix of length n.

(RefLink[MatrixTDistribution, paclet:ref/MatrixTDistribution])[(Subscript[Σ, row]),(Subscript[Σ, col]),ν] is the distribution of (RefLink[MatrixNormalDistribution, paclet:ref/MatrixNormalDistribution])[Σ,(Subscript[Σ, col])] with Σ sampled from (RefLink[InverseWishartMatrixDistribution, paclet:ref/InverseWishartMatrixDistribution])[ν+n-1,(Subscript[Σ, row])].

(RefLink[MatrixTDistribution, paclet:ref/MatrixTDistribution])[μ,c (Subscript[Σ, row]),(c^(-1)) (Subscript[Σ, col]),ν] has the same distribution as (RefLink[MatrixTDistribution, paclet:ref/MatrixTDistribution])[μ,(Subscript[Σ, row]),(Subscript[Σ, col]),ν] for any positive real constant c.

The covariance matrices (Subscript[Σ, row]) and (Subscript[Σ, col]) can be any symmetric positive definite matrices of real numbers of dimensions {n,n} and {m,m}, respectively. The degrees of freedom parameter ν can be any positive number, and the mean matrix μ can be any matrix of real numbers of dimensions {n,m}.

(RefLink[MatrixTDistribution, paclet:ref/MatrixTDistribution]) can be used with such functions as (RefLink[MatrixPropertyDistribution, paclet:ref/MatrixPropertyDistribution]), (RefLink[EstimatedDistribution, paclet:ref/EstimatedDistribution]), and (RefLink[RandomVariate, paclet:ref/RandomVariate]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (13)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Sample from matrix t distribution:

sigR={{3,1},{1,4}};
sigC={{1,-1/2},{-1/2,2}};

RandomVariate[MatrixTDistribution[sigR,sigC,3]]

Mean and variance:

Mean[MatrixTDistribution[{{1,2},{3,4},{5,6}},DiagonalMatrix[{2,1,3}],{{2,1},{1,3}},4]]//MatrixForm

Variance[MatrixTDistribution[{{1,2},{3,4},{5,6}},DiagonalMatrix[{2,1,3}],{{2,1},{1,3}},4]]//MatrixForm

OpenersExampleSection1(Spacer1)Scope  (6)

Generate a single pseudorandom matrix:

RandomVariate[MatrixTDistribution[{{1,1/3},{1/3,1}},IdentityMatrix[3],2]]

Generate a single pseudorandom matrix with nonzero mean:

RandomVariate[MatrixTDistribution[{{1,2,3},{4,5,6}},{{1,1/3},{1/3,1}},IdentityMatrix[3],2]]

Generate a set of pseudorandom matrices:

RandomVariate[MatrixTDistribution[{{1,1/3},{1/3,1}},IdentityMatrix[3],2],3]

Sample at extended precision:

RandomVariate[MatrixTDistribution[{{1,1/3},{1/3,1}},IdentityMatrix[3],2],WorkingPrecision->20]

RandomVariate[MatrixTDistribution[{{1,2,3},{4,5,6}},{{1,1/3},{1/3,1}},IdentityMatrix[3],2],WorkingPrecision->20]

Distribution parameters estimation:

dist=MatrixTDistribution[{{3,1},{1,2}},ToeplitzMatrix[{4,2,1}],4];sample=RandomVariate[dist,10^3];

Estimate the distribution parameters from sample data:

edist=EstimatedDistribution[sample,MatrixTDistribution[Array[row,{2,2}],Array[col,{3,3}],ν]]

Compare (RefLink[LogLikelihood, paclet:ref/LogLikelihood]) for both distributions:

LogLikelihood[#,sample]&/@{edist,dist}

Skewness and kurtosis:

Skewness[MatrixTDistribution[{{2,1},{1,3}},IdentityMatrix[3],5]]//MatrixForm

Kurtosis[MatrixTDistribution[{{2,1},{1,3}},IdentityMatrix[3],5]]//MatrixForm

Probability density function:

dist=MatrixTDistribution[IdentityMatrix[2],DiagonalMatrix[{2,1}],3];PDF[dist,{{1.,2.},{3,4.}}]

Plot PDF for a diagonal matrices:

Plot3D[PDF[dist,DiagonalMatrix[{a,b}]],{a,-2,2},{b,-1,1}]

OpenersExampleSection3(Spacer1)Properties & Relations  (4)

Matrix t distribution is defined up to a positive multiplicative constant:

sigr={{2,1},{1,4}};
sigc=ToeplitzMatrix[{9,3,1}];
𝒟1=MatrixTDistribution[sigr,sigc,3];

Equivalent distribution with row and column scale matrices multiplied and divided by a positive constant:

c=2;
𝒟2=MatrixTDistribution[c*sigr,sigc/c,3];

Compute the PDF of the distributions at a random point:

mat=RandomReal[{-10,10},{2,3}]

PDF[𝒟1,mat]==PDF[𝒟2,mat]

(RefLink[MatrixTDistribution, paclet:ref/MatrixTDistribution])[(Subscript[Σ, row]),(Subscript[Σ, col]),ν] is a parameter mixture of (RefLink[MatrixNormalDistribution, paclet:ref/MatrixNormalDistribution])[Σ,(Subscript[Σ, col])] with Σ following (RefLink[InverseWishartMatrixDistribution, paclet:ref/InverseWishartMatrixDistribution])[ν+n-1,(Subscript[Σ, row])]:

ν=3;
n=2;
Σr=IdentityMatrix[n];
Σc=IdentityMatrix[3];
invW=InverseWishartMatrixDistribution[ν+n-1,Σr];

Create a sample following the parameter mixture of (RefLink[MatrixNormalDistribution, paclet:ref/MatrixNormalDistribution]) with (RefLink[InverseWishartMatrixDistribution, paclet:ref/InverseWishartMatrixDistribution]):

sampleSize=10^3;
sigmas=RandomVariate[invW,10^3];
sample=Table[RandomVariate[MatrixNormalDistribution[s,Σc]],{s,sigmas}];

Fit the sample data to (RefLink[MatrixTDistribution, paclet:ref/MatrixTDistribution]):

edist=EstimatedDistribution[sample,MatrixTDistribution[Array[s1,{2,2}],Array[s2,{3,3}],nu]]

Compute log-likelihood ratio statistic against the appropriate (RefLink[MatrixTDistribution, paclet:ref/MatrixTDistribution])

ratio=LogLikelihood[edist,sample]-LogLikelihood[MatrixTDistribution[Σr,Σc,ν],sample]

Log-likelihood ratio follows (RefLink[ChiSquareDistribution, paclet:ref/ChiSquareDistribution]) with the parameter equal to the number of degrees of freedom:

dof=(Length[Σr]+1)*Length[Σr]/2+(Length[Σc]+1)*Length[Σc]/2+1

Compute the p-value of log-likelihood ratio test:

pval=SurvivalFunction[ChiSquareDistribution[dof],2ratio]

For matrix 𝓂 sampled from matrix t distribution, the expression (Subscript[v, 1]).𝓂.(Subscript[v, 2]) follows Student t distribution for any nonzero vectors (Subscript[v, 1]) and (Subscript[v, 2]) with lengths that match with the dimension of 𝓂:

v1=RandomReal[1,2];v2=RandomReal[1,3];

Use (RefLink[MatrixPropertyDistribution, paclet:ref/MatrixPropertyDistribution]) to sample values of the expression (Subscript[v, 1]).𝓂.(Subscript[v, 2]):

(Subscript[Σ, r])={{1,4/5},{4/5,1}};(Subscript[Σ, c])={{2,1,0},{1,3,1},{0,1,2}};df=5;

data=RandomVariate[MatrixPropertyDistribution[v1.𝓂.v2,𝓂\[Distributed]MatrixTDistribution[(Subscript[Σ, r]),(Subscript[Σ, c]),df]],10^4];

Check agreement with the expected t distribution:

t𝒟=StudentTDistribution[0,Sqrt[(v1.(Subscript[Σ, r]).v1)(v2.(Subscript[Σ, c]).v2)/df],df];

DistributionFitTest[data,t𝒟]

Show[Histogram[data,Automatic,PDF],Plot[PDF[t𝒟,x],{x,-4,4},PlotRange->All]]

For matrix 𝓂 sampled from matrix t distribution, 𝓂.v follows multivariate t distribution for any nonzero vector v with length that matches with the number of columns of 𝓂:

v=RandomReal[1,3];

Use (RefLink[MatrixPropertyDistribution, paclet:ref/MatrixPropertyDistribution]) to sample values of 𝓂.v:

(Subscript[Σ, r])={{1,4/5},{4/5,1}};(Subscript[Σ, c])={{2,1,0},{1,3,1},{0,1,2}};df=5;

data=RandomVariate[MatrixPropertyDistribution[𝓂.v,𝓂\[Distributed]MatrixTDistribution[(Subscript[Σ, r]),(Subscript[Σ, c]),df]],10^4];

Verify goodness of fit with the expected distribution:

DistributionFitTest[data,MultivariateTDistribution[(Subscript[Σ, r]) (v.(Subscript[Σ, c]).v)/df,df]]

OpenersExampleSection4(Spacer1)Possible Issues  (1)

Matrix t distribution is defined up to a multiplicative scaling constant. The estimated parameters may not be close to the ones that specify the underlying distribution:

ν=4;
sigr=ToeplitzMatrix[{9,3,1}];
sigc=DiagonalMatrix[{1,2}];
dist=MatrixTDistribution[sigr,sigc,ν];

Sample from the matrix t distribution:

sample=RandomVariate[dist,10^4];

Estimate the distribution:

edist=EstimatedDistribution[sample,MatrixTDistribution[Array[s1,{3,3}],Array[s2,{2,2}],ν]];

Compare the estimated scale parameters with the ones of the underlying distribution:

MatrixForm/@{esigr=First[edist],sigr}

MatrixForm/@{esigc=edist[[2]],sigc}

Kronecker products of the scale matrices are close to each other:

NumberForm[KroneckerProduct[sigr,sigc]-KroneckerProduct[esigr,esigc]//MatrixForm,4]

The (RefLink[LogLikelihood, paclet:ref/LogLikelihood]) of the distributions indicate that the estimate is good:

LogLikelihood[#,sample]&/@{dist,edist}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[MatrixNormalDistribution, paclet:ref/MatrixNormalDistribution])  ▪  (RefLink[MatrixPropertyDistribution, paclet:ref/MatrixPropertyDistribution])  ▪  (RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution])  ▪  (RefLink[WishartMatrixDistribution, paclet:ref/WishartMatrixDistribution])  ▪  (RefLink[InverseWishartMatrixDistribution, paclet:ref/InverseWishartMatrixDistribution])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Matrix Distributions, paclet:guide/MatrixDistributions])}})}})