({{, (RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution])[Σ,ν]
represents the multivariate Student t distribution with scale matrix Σ and degrees of freedom parameter ν.}, {, (RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution])[μ,Σ,ν]
represents the multivariate Student t distribution with location μ, scale matrix Σ, and ν degrees of freedom.}})

OpenersNotesSection(Spacer1)Details

The probability density for vector x in a multivariate t distribution is proportional to (((ν+(x-μ).(Σ^(-1)).(x-μ)))^(- (ν+p)/2)), where p is the length of Σ.

The multivariate Student t distribution characterizes the ratio of a multinormal to the covariance between the variates.

(RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution]) allows Σ to be any p×p symmetric positive definite matrix of real numbers, μ any vector of real numbers where p=(RefLink[Length, paclet:ref/Length])[μ], and ν any positive real number.

The mean vector μ and covariance matrix Σ can be quantities such that μ⊗μ and Σ have the same unit dimensions componentwise, and ν can be a dimensionless quantity. »

(RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution]) can be used with such functions as (RefLink[Mean, paclet:ref/Mean]), (RefLink[CDF, paclet:ref/CDF]), and (RefLink[RandomVariate, paclet:ref/RandomVariate]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (25)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Probability density function:

Table[Plot3D[PDF[MultivariateTDistribution[{{1,ρ},{ρ,1}},10],{x,y}],{x,-3,3},{y,-3,3},PlotRange->All,MeshFunctions->{#3&},MeshShading->{None,Red,None,Yellow},AxesLabel->Automatic,PlotLabel->Row[{"ρ = ",ρ}]],{ρ,{-.9,-.5,-.1,0,.3,.7}}]

PDF[MultivariateTDistribution[{{1,ρ},{ρ,1}},ν],{x,y}]

Cumulative distribution function:

Table[Plot3D[CDF[MultivariateTDistribution[{{1,ρ},{ρ,1}},10],{x,y}],{x,-3,3},{y,-3,3},MeshFunctions->{#3&},MeshShading->{None,Red,None,Yellow},AxesLabel->Automatic,PlotLabel->Row[{"ρ = ",ρ}]],{ρ,{-.9,-.5,-.1,0,.3,.7}}]

Mean and variance:

Mean[MultivariateTDistribution[{{1,ρ},{ρ,1}},ν]]

Variance[MultivariateTDistribution[{{1,ρ},{ρ,1}},ν]]

Covariance:

Covariance[MultivariateTDistribution[{{1,ρ},{ρ,1}},ν]]

OpenersExampleSection1(Spacer1)Scope  (9)

Generate a sample of pseudorandom vectors from a bivariate t distribution:

sample=RandomVariate[𝒹=MultivariateTDistribution[{{2,-1/3},{-1/3,2/3}},5],10^4];

Visualize the sample using a histogram:

{Histogram3D[sample,{.5},"PDF",ColorFunction->"Rainbow",PlotRange->{{-4,4},{-3,3},All}],Plot3D[PDF[𝒹,{x,y}],{x,-4,4},{y,-3,3},ColorFunction->"Rainbow",PlotPoints->35,PlotRange->All]}

Distribution parameters estimation:

sample=RandomVariate[MultivariateTDistribution[{{1,1/3},{1/3,1}},7],10^2];

Estimate the distribution parameters from sample data:

edist=EstimatedDistribution[sample, MultivariateTDistribution[{{a,b},{b,c}},ν],ParameterEstimator->"MethodOfMoments"]

Goodness-of-fit test:

DistributionFitTest[sample,edist]

Skewness:

Skewness[MultivariateTDistribution[{{1,1/2,-1/3},{1/2,1,0},{-1/3,0,1}},5]]

Skewness is always 0 when defined:

Skewness[MultivariateTDistribution[{{1,s,t},{s,1,w},{t,w,1}},ν]]

Kurtosis:

Kurtosis[MultivariateTDistribution[{{1,1/2,-1/3},{1/2,1,0},{-1/3,0,1}},5]]

Kurtosis depends only on the degrees of freedom:

Kurtosis[MultivariateTDistribution[{{1,s,t},{s,1,w},{t,w,1}},ν]]

As the number of degrees of freedom approaches ∞, the kurtosis approaches kurtosis of (PackageLink[MultinormalDistribution, paclet:MultivariateStatistics/ref/MultinormalDistribution, MultivariateStatistics Package Symbol]):

Limit[Refine[Kurtosis[MultivariateTDistribution[{{1,s,t},{s,1,w},{t,w,1}},ν]],ν>4],ν->∞]

Kurtosis[MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2]),(Subscript[μ, 3])},{{1,s,t},{s,1,w},{t,w,1}}]]

Correlation for bivariate t distribution:

Correlation[MultivariateTDistribution[{{1,ρ},{ ρ,1}},ν]]//Refine[#,ν>2]&//MatrixForm

Different mixed moments for a standard bivariate t distribution:

FormulaGrid[list_,type_]:=Grid[Transpose[{list}],Alignment->{Left,Automatic},Background->{None,{{Lighter[Blend[Switch[type,M,{Blue,Green},CM,{Red,Orange},FM,{Magenta,Cyan},C,{Purple,Red}]],.8],White}}},Dividers->{None,{Darker[Gray,.6],{False},Darker[Gray,.6]}},ItemSize->35]

FormulaGrid[Table[Moment[MultivariateTDistribution[{{1,0},{0,1}},ν],{2,k}]//Simplify,{k,0,4}],M]

Mixed central moments:

FormulaGrid[Table[CentralMoment[MultivariateTDistribution[{{1,0},{0,1}},ν],{2,k}]//Simplify,{k,0,4}],CM]

Mixed factorial moments:

FormulaGrid[Table[FactorialMoment[MultivariateTDistribution[{{1,0},{0,1}},ν],{2,k}]//Simplify,{k,0,4}],FM]

Mixed cumulants:

FormulaGrid[Table[Cumulant[MultivariateTDistribution[{{1,0},{0,1}},ν],{2,k}]//Simplify,{k,0,4}],C]

Hazard function:

ParallelTable[Plot3D[HazardFunction[MultivariateTDistribution[{{2,ρ},{ρ,2/3}},5],{x,y}],{x,-4,12},{y,-4,6},PlotRange->All,MeshFunctions->{#3&},MeshShading->{None,Red,None,Yellow},PlotPoints->25,AxesLabel->Automatic,Exclusions->None],{ρ,{-0.5,0.1,0.8}}]

The marginals follow (RefLink[StudentTDistribution, paclet:ref/StudentTDistribution]):

𝒟=MultivariateTDistribution[{{1,ρ},{ρ,1}},ν];

MarginalDistribution[𝒟,1]

MarginalDistribution[𝒟,2]

Consistent use of (RefLink[Quantity, paclet:ref/Quantity]) in parameters yields (RefLink[QuantityDistribution, paclet:ref/QuantityDistribution]):

μ=QuantityArray[{0.5,0.7},"Teslas"];
Σ=QuantityArray[{{10,1.2},{1.2,17}},"Gausses"^2];
ν=10;

𝒟=MultivariateTDistribution[μ,Σ,ν]

Covariance[𝒟]//Normal

OpenersExampleSection2(Spacer1)Applications  (3)

Show a distribution function and its histogram in the same plot:

CompareHistogram3D[dist_,{xmin_,xmax_,dx_},{ymin_,ymax_,dy_},df_:PDF,opts___?OptionQ]:=
Module[{hist,dplot},
hist=Histogram3D[RandomVariate[dist,10^4],{{xmin,xmax,dx},{ymin,ymax,dy}},ToString[df],PlotRange->{{xmin,xmax},{ymin,ymax},All},ChartBaseStyle->Opacity[0.5,ColorData[1,1]]];
dplot=Plot3D[df[dist,{x,y}],{x,xmin,xmax},{y,ymin,ymax},Mesh->{Range[xmin,xmax,dx],Range[ymin,ymax,dy]},PlotRange->All,MeshStyle->Gray,PlotStyle->Hue[.15,.7,.8]];
Show[hist,dplot]
];

Compare the PDF to its histogram version:

𝒟=MultivariateTDistribution[{{1,1/3},{1/3,1}},7];

CompareHistogram3D[𝒟,{-5,5,.5},{-3,3,.5},PDF]

Compare the CDF to its histogram version:

CompareHistogram3D[𝒟,{-5,5,.5},{-3,3,.5},CDF]

A multivariate Student t distribution is used to define a copula distribution:

𝒟 = CopulaDistribution[{"MultivariateT",{{1/2,2/7},{2/7,3}},7}, {UniformDistribution[{0,1}],UniformDistribution[{0,1}]}];

Probability density function:

Plot3D[Evaluate[PDF[𝒟,{x,y}]],{x,-0.2,1.2},{y,-0.2,1.2},Exclusions->{{x(1-x)==0,0≤y≤1},{y(1-y)==0,0≤x≤1}}]

Mean and variance:

Mean[𝒟]

Variance[𝒟]

Generate random numbers:

Histogram3D[RandomVariate[𝒟,10^5],{.05},PDF]

Stock prices modeled with geometric Brownian motion are assumed to be normally distributed in their log returns. Here we examine this with stock prices of five companies, GOOG, MSFT, FB, AAPL, and INTC, in the year 2015:

prices=TimeSeries[];

DateListPlot[prices,PlotLegends->{"GOOG","MSFT","FB","AAPL","INTC"}]

Compute the log returns:

logreturn=Differences[Log[prices["Values"]]];

Fit the data to (RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution]) and perform (RefLink[KolmogorovSmirnovTest, paclet:ref/KolmogorovSmirnovTest]):

multiN=EstimatedDistribution[logreturn,MultinormalDistribution[Array[x,5],Array[s,{5,5}]]];

KolmogorovSmirnovTest[logreturn,multiN,"ShortTestConclusion"]

Fit the data to (RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution]) and also perform the same test:

multiT=EstimatedDistribution[logreturn,MultivariateTDistribution[Array[x,5],Array[s,{5,5}],nu]];

KolmogorovSmirnovTest[logreturn,multiT,"ShortTestConclusion"]

OpenersExampleSection3(Spacer1)Properties & Relations  (6)

Equal probability contours for a bivariate t distribution:

ContourPlot[PDF[MultivariateTDistribution[{{1,1/2},{1/2,1}},10],{x,y}],{x,-2.5,2.5},{y,-2.5,2.5}]

Multivariate Student t distribution is closed under affine transformations:

A=(({{a11, a12}, {a21, a22}}));b={b1,b2};

TransformedDistribution[A.{u,v}+b,{u,v}\[Distributed]MultivariateTDistribution[{{1,ρ},{ρ,1}},ν]]

%==MultivariateTDistribution[b,A.{{1,ρ},{ρ,1}}.A\[Transpose],ν]//Simplify

The affine transformation need not preserve the distribution dimensionality:

TransformedDistribution[(Subscript[a, 1])u+(Subscript[a, 2]) v+c,{u,v}\[Distributed]MultivariateTDistribution[{{1,ρ},{ρ,1}},ν]]

TransformedDistribution[(({{2, 1, -1}, {2, 3, 2}})).{x1,x2,x3},{x1,x2,x3}\[Distributed]MultivariateTDistribution[(({{2, -1, 0}, {-1, 3, 1}, {0, 1, 2}})),ν]]

Relationships to other distributions:

Multinormal distribution is the limit of (RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution]) as ν goes to ∞:

Limit[PDF[MultivariateTDistribution[{μ1,μ2},{{1,ρ},{ ρ,1}},ν],{x,y}],ν->∞]

PDF[MultinormalDistribution[{μ1,μ2},{{1,ρ},{ ρ,1}}],{x,y}]

%-%%//Simplify

The default location is 0:

PDF[MultivariateTDistribution[{0,0},{{a,b},{b,c}},ν],{x,y}]

PDF[MultivariateTDistribution[{{a,b},{b,c}},ν],{x,y}]

%-%%//FullSimplify

(RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution]) is equivalent to (RefLink[CopulaDistribution, paclet:ref/CopulaDistribution]) with multivariate T kernel and Student t marginals:

Σ=(({{1, ρ12, ρ13}, {ρ12, 1, ρ23}, {ρ13, ρ23, 1}}));
c𝒟=CopulaDistribution[{"MultivariateT",Σ,ν},{StudentTDistribution[μ1,σ1,ν],StudentTDistribution[μ2,σ2,ν],StudentTDistribution[μ3,σ3,ν]}];
mvt𝒟=MultivariateTDistribution[{μ1,μ2,μ3},Σ KroneckerProduct[{σ1,σ2,σ3},{σ1,σ2,σ3}],ν];

FullSimplify[PDF[c𝒟,{x,y,z}]/PDF[mvt𝒟,{x,y,z}],σ1>0&&σ2>0&&σ3>0&&ν>0&&{μ1,μ2,μ3,x,y,z}∈Reals]

OpenersExampleSection4(Spacer1)Possible Issues  (2)

(RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution]) is not defined when Σ is not a symmetric positive definite matrix:

PDF[MultivariateTDistribution[{{1,I/2},{1/2,1}},10],{x,y}]

(RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution]) is not defined when ν is not positive:

PDF[MultivariateTDistribution[{{1,1/2},{1/2,1}},-3],{x,y}]

Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:

Variance[MultivariateTDistribution[{{1,ρ},{ρ,1}},ν]]/.{ρ->1,ν->I}

OpenersExampleSection5(Spacer1)Neat Examples  (1)

PDFs for different correlations:

Grid[{Table[ContourPlot[PDF[MultivariateTDistribution[{{1,ρ},{ρ,1}},10],{x,y}],{x,-3,3},{y,-3,3},ImageSize->68,FrameTicks->None,PlotLabel->ρ],{ρ,{-0.7,-0.5,-0.3,0,0.3,0.5,0.7}}]}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[StudentTDistribution, paclet:ref/StudentTDistribution])  ▪  (RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution])  ▪  (RefLink[HotellingTSquareDistribution, paclet:ref/HotellingTSquareDistribution])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Parametric Statistical Distributions, paclet:guide/ParametricStatisticalDistributions])}, {▪(RefLinkPlain[Normal and Related Distributions, paclet:guide/NormalRelatedDistributions])}})}})