({{, (RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution])[μ,Σ]
represents a multivariate normal (Gaussian) distribution with mean vector μ and covariance matrix Σ.}, {, (RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution])[Σ]
represents a multivariate normal distribution with zero mean and covariance matrix Σ.}})

OpenersNotesSection(Spacer1)Details

The probability density for vector x in a multivariate normal distribution is proportional to (e^(-(1/2) (x-μ).(Σ^(-1)).(x-μ))).

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

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

(RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution]) 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  (27)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Probability density function:

ParallelTable[Plot3D[PDF[MultinormalDistribution[{-1,1},{{1,ρ 2},{ρ 2,4}}],{x,y}],{x,-3,3},{y,-6,6},PlotRange->All,MeshFunctions->{#3&},MeshShading->{None,Red,None,Yellow},PlotPoints->25],{ρ,{-.7,-0.4,0,0.3,0.5,0.8}}]

PDF[MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2])},{{((Subscript[σ, 1])^2),ρ (Subscript[σ, 1]) (Subscript[σ, 2])},{ρ (Subscript[σ, 1]) (Subscript[σ, 2]),((Subscript[σ, 2])^2)}}],{x,y}]

Cumulative distribution function:

ParallelTable[Plot3D[CDF[MultinormalDistribution[{-1,1},{{1,ρ 2},{ρ  2,4}}],{x,y}],{x,-3,3},{y,-6,6},MeshFunctions->{#3&},MeshShading->{None,Red,None,Yellow},PlotPoints->25],{ρ,{-.7,-0.4,0,0.3,0.5,0.8}}]

Mean and variance:

Σ={{((Subscript[σ, 1])^2),ρ (Subscript[σ, 1])(Subscript[σ, 2])},{ρ (Subscript[σ, 1])(Subscript[σ, 2]),((Subscript[σ, 2])^2)}};

Mean[MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2])},Σ]]

Variance[MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2])},Σ]]

Covariance:

Σ={{((Subscript[σ, 1])^2),ρ (Subscript[σ, 1])(Subscript[σ, 2])},{ρ (Subscript[σ, 1])(Subscript[σ, 2]),((Subscript[σ, 2])^2)}};

Covariance[MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2])},Σ]]

OpenersExampleSection1(Spacer1)Scope  (8)

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

data=RandomVariate[𝒹=MultinormalDistribution[{1,2},{{2,-1/3},{-1/3,2/3}}],10^4];

Visualize the sample using a histogram:

{Histogram3D[data,20,"PDF",ColorFunction->"Rainbow",PlotRange->{{-4,5},{-2,5},All}],Plot3D[PDF[𝒹,{x,y}],{x,-4,5},{y,-2,5},ColorFunction->"Rainbow",PlotPoints->35,PlotRange->All]}

Distribution parameters estimation:

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

Estimate the distribution parameters from sample data:

edist=EstimatedDistribution[sample, MultinormalDistribution[Array[μ,3],Array[s,{3,3}]]]

Goodness-of-fit test:

DistributionFitTest[sample,edist]

Skewness and kurtosis are constant vectors:

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

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

Correlation:

Σ=(({{((Subscript[σ, 1])^2), (Subscript[ρ, 12]) (Subscript[σ, 1]) (Subscript[σ, 2]), (Subscript[ρ, 13]) (Subscript[σ, 1]) (Subscript[σ, 3])}, {(Subscript[ρ, 12]) (Subscript[σ, 1]) (Subscript[σ, 2]), ((Subscript[σ, 2])^2), (Subscript[ρ, 23]) (Subscript[σ, 2]) (Subscript[σ, 3])}, {(Subscript[ρ, 13]) (Subscript[σ, 1]) (Subscript[σ, 3]), (Subscript[ρ, 23]) (Subscript[σ, 2]) (Subscript[σ, 3]), ((Subscript[σ, 3])^2)}}));

𝒟1=MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2]),(Subscript[μ, 3])},Σ];

(R=Correlation[𝒟1])//FullSimplify[#,(Subscript[σ, 1])>0&&(Subscript[σ, 2])>0&&(Subscript[σ, 3])>0]&//MatrixForm

The (RefLink[ImplicitRegion, paclet:ref/ImplicitRegion]) for 3D correlation coefficients of a multinormal distribution:

mat={{1,r12,r13},{r12,1,r23},{r13,r23,1}};

𝒟=MultinormalDistribution[mat];

corℛ=ImplicitRegion[DistributionParameterAssumptions[𝒟],{{r12,-1,1},{r13,-1,1},{r23,-1,1}}];

Use (RefLink[RandomPoint, paclet:ref/RandomPoint]) to sample from uniform distribution over 3D correlation coefficients region:

cors=RandomPoint[corℛ,5000];

Graphics3D[{PointSize[Tiny],Black,Point[cors]}]

Estimate probability that determinant of the random correlation matrix is less than 0.1:

Probability[Det[mat]<0.1,
{r12,r13,r23}\[Distributed]RandomPoint[corℛ,10^5]]//N

Hazard function:

ParallelTable[Plot3D[HazardFunction[MultinormalDistribution[{-1,1},{{1,ρ 2},{ρ 2,4}}],{x,y}],{x,-3,6},{y,-3,8},PlotRange->All,MeshFunctions->{#3&},MeshShading->{None,Red,None,Yellow},PlotPoints->35],{ρ,{-.4,0.1,0.8}}]

Univariate marginals follow a (RefLink[NormalDistribution, paclet:ref/NormalDistribution]):

Σ=(({{((Subscript[σ, 1])^2), (Subscript[ρ, 12]) (Subscript[σ, 1]) (Subscript[σ, 2]), (Subscript[ρ, 13]) (Subscript[σ, 1]) (Subscript[σ, 3])}, {(Subscript[ρ, 12]) (Subscript[σ, 1]) (Subscript[σ, 2]), ((Subscript[σ, 2])^2), (Subscript[ρ, 23]) (Subscript[σ, 2]) (Subscript[σ, 3])}, {(Subscript[ρ, 13]) (Subscript[σ, 1]) (Subscript[σ, 3]), (Subscript[ρ, 23]) (Subscript[σ, 2]) (Subscript[σ, 3]), ((Subscript[σ, 3])^2)}}));𝒟=MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2]),(Subscript[μ, 3])},Σ];

MarginalDistribution[𝒟,1]

Multivariate marginals follow a multivariate normal distribution:

MarginalDistribution[𝒟,{1,3}]

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

measurements𝒟=MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2]),(Subscript[μ, 3])},(({{((Subscript[σ, 1])^2), (Subscript[ρ, 12]) (Subscript[σ, 1]) (Subscript[σ, 2]), (Subscript[ρ, 13]) (Subscript[σ, 1]) (Subscript[σ, 3])}, {(Subscript[ρ, 12]) (Subscript[σ, 1]) (Subscript[σ, 2]), ((Subscript[σ, 2])^2), (Subscript[ρ, 23]) (Subscript[σ, 2]) (Subscript[σ, 3])}, {(Subscript[ρ, 13]) (Subscript[σ, 1]) (Subscript[σ, 3]), (Subscript[ρ, 23]) (Subscript[σ, 2]) (Subscript[σ, 3]), ((Subscript[σ, 3])^2)}}))]/.{(Subscript[μ, 1])->(Quantity[10, (("cm")^2), centimeters squared, (("Centimeters")^2)]),(Subscript[σ, 1])->(Quantity[0.1, (("cm")^2), centimeters squared, (("Centimeters")^2)]),(Subscript[μ, 2])->(Quantity[15, "g", grams, "Grams"]),(Subscript[σ, 2])->(Quantity[0.67, "g", grams, "Grams"]),(Subscript[μ, 3])->(Quantity[270, "K", kelvins, "Kelvins"]),(Subscript[σ, 3])->(Quantity[0.25, "K", kelvins, "Kelvins"]),(Subscript[ρ, 12])->0.4,(Subscript[ρ, 13])->0,(Subscript[ρ, 23])->-0.1}

Find standard deviations of each measurement:

StandardDeviation[measurements𝒟]

OpenersExampleSection2(Spacer1)Generalizations & Extensions  (1)

(RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution])[Σ] is understood to have zero mean:

MultinormalDistribution[(({{((Subscript[σ, 1])^2), (Subscript[ρ, 12]) (Subscript[σ, 1]) (Subscript[σ, 2]), (Subscript[ρ, 13]) (Subscript[σ, 1]) (Subscript[σ, 3])}, {(Subscript[ρ, 12]) (Subscript[σ, 1]) (Subscript[σ, 2]), ((Subscript[σ, 2])^2), (Subscript[ρ, 23]) (Subscript[σ, 2]) (Subscript[σ, 3])}, {(Subscript[ρ, 13]) (Subscript[σ, 1]) (Subscript[σ, 3]), (Subscript[ρ, 23]) (Subscript[σ, 2]) (Subscript[σ, 3]), ((Subscript[σ, 3])^2)}}))]

OpenersExampleSection3(Spacer1)Applications  (2)

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]];
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:

𝒟=MultinormalDistribution[{1,1},{{2,1/4},{1/4,3}}];

CompareHistogram3D[𝒟,{-5,6,1},{-3,7,1},PDF]

Compare the CDF to its histogram version:

CompareHistogram3D[𝒟,{-5,6,1},{-3,7,1},CDF]

Specify multinormal distribution for values of three incoming currents to a 4-way node:

ampDist=MultinormalDistribution[{Quantity[4,"Amperes"],Quantity[1.5,"Amperes"],Quantity[.5,"Amperes"]},QuantityArray[{{.05,.012,.003},{.012,.035,.001},{.003,.001,.02}},"Amperes"^2]]

Find the distribution of the current leaving the node:

TransformedDistribution[(Subscript[i, 1])+(Subscript[i, 2])+(Subscript[i, 3]),{(Subscript[i, 1]),(Subscript[i, 2]),(Subscript[i, 3])}\[Distributed]ampDist]

Find the 95% confidence interval for the current value:

InverseCDF[%,{((1-0.95)/2),((1+0.95)/2)}]

OpenersExampleSection4(Spacer1)Properties & Relations  (10)

Equal probability contours for a bivariate normal distribution:

ContourPlot[PDF[MultinormalDistribution[{0,0},{{2,1/2},{1/2,1}}],{x,y}],{x,-3,3},{y,-3,3}]

The multinormal distribution is closed under affine transformation:

A=(({{a11, a12, a13}, {a21, a22, a23}, {a31, a32, a33}}));b={b1,b2,b3};

Σ=(({{((σ1)^2), ρ12 σ1 σ2, ρ13 σ1 σ3}, {ρ12 σ1 σ2, ((σ2)^2), ρ23 σ2 σ3}, {ρ13 σ1 σ3, ρ23 σ2 σ3, ((σ3)^2)}}));

TransformedDistribution[A.{u,v,w}+b,{u,v,w}\[Distributed]MultinormalDistribution[{μ1,μ2,μ3},Σ]]==MultinormalDistribution[A.{μ1,μ2,μ3}+b,A.Σ.A\[Transpose]//Expand]

For specific values:

M=(({{1, 2, 3}, {4, 5, -6}, {7, 8, 9}}));c={1,2,3};
Σ2=(({{3, 1/3, 3/2}, {1/3, 2/3, -1}, {3/2, -1, 4}}));

TransformedDistribution[M.{u,v,w}+c,{u,v,w}\[Distributed]MultinormalDistribution[{1,-2,2},Σ2]]

Relationships to other distributions:

(RefLink[NormalDistribution, paclet:ref/NormalDistribution]) is the univariate case of multinormal distribution:

PDF[MultinormalDistribution[{μ},{{(σ^2)}}],{x}]

PDF[NormalDistribution[μ,σ],x]

FullSimplify[%-%%,σ>0]

(RefLink[BinormalDistribution, paclet:ref/BinormalDistribution]) is the two-dimensional case of multinormal distribution:

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

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

%-%%//Simplify[#,σ1>0&&σ2>0]&

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

Multinormal distribution is related to (RefLink[RiceDistribution, paclet:ref/RiceDistribution]):

𝒟=TransformedDistribution[Norm[{u,v,w}],{u,v,w}\[Distributed]MultinormalDistribution[{α,α,α},{{β^2,0,0},{0,β^2,0},{0,0,β^2}}]];

Block[{m=3/2,α=5,β=2},Show[Histogram[RandomVariate[𝒟,10^4],20,"PDF"],Plot[PDF[RiceDistribution[m,α Sqrt[2m],β Sqrt[m]],x],{x,0,16},PlotStyle->Thick]]]

(RefLink[LogMultinormalDistribution, paclet:ref/LogMultinormalDistribution]) is a transformation of (RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution]):

Σ={{((Subscript[σ, 1])^2),ρ (Subscript[σ, 1])(Subscript[σ, 2])},{ρ (Subscript[σ, 1])(Subscript[σ, 2]),((Subscript[σ, 2])^2)}};

TransformedDistribution[{Exp[u],Exp[v]},{u,v}\[Distributed]MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2])},Σ]]

(RefLink[NormalDistribution, paclet:ref/NormalDistribution]) can be obtained from (RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution]):

Σ={{((Subscript[σ, 1])^2),ρ (Subscript[σ, 1])(Subscript[σ, 2])},{ρ (Subscript[σ, 1])(Subscript[σ, 2]),((Subscript[σ, 2])^2)}};TransformedDistribution[u+v,{u,v}\[Distributed]MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2])},Σ]]

(RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution]) is equivalent to (RefLink[CopulaDistribution, paclet:ref/CopulaDistribution]) with multinormal kernel and Gaussian marginals:

Σ=(({{1, ρ12, ρ13}, {ρ12, 1, ρ23}, {ρ13, ρ23, 1}}));
c𝒟=CopulaDistribution[{"Multinormal",Σ},{NormalDistribution[μ1,σ1],NormalDistribution[μ2,σ2],NormalDistribution[μ3,σ3]}];

Corresponding multinormal distribution:

mn𝒟=MultinormalDistribution[{μ1,μ2,μ3},Σ*KroneckerProduct[{σ1,σ2,σ3},{σ1,σ2,σ3}]];

The probability density functions are equal:

PDF[c𝒟,{x,y,z}]==PDF[mn𝒟,{x,y,z}]//Simplify[#,σ1>0&&σ2>0&&σ3>0]&

OpenersExampleSection5(Spacer1)Possible Issues  (2)

(RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution]) is not defined when μ is not a vector of real numbers:

Mean[MultinormalDistribution[{1,I},{{2,1/2},{1/2,1}}]]

(RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution]) is not defined when the dimensions of μ and Σ are not consistent:

Mean[MultinormalDistribution[{1,2,3},{{2,1/2},{1/2,1}}]]

(RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution]) is not defined when Σ is not symmetric and positive definite:

Mean[MultinormalDistribution[{1,2},{{2,8},{1/2,1}}]]

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

Mean[MultinormalDistribution[{(Subscript[μ, 1]),(Subscript[μ, 2])},{{((Subscript[σ, 11])^2),ρ*(Subscript[σ, 11])*(Subscript[σ, 22])},{ρ*(Subscript[σ, 11])*(Subscript[σ, 22]),((Subscript[σ, 22])^2)}}]]/.{(Subscript[μ, 1])->1,(Subscript[μ, 2])->I}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[NormalDistribution, paclet:ref/NormalDistribution])  ▪  (RefLink[BinormalDistribution, paclet:ref/BinormalDistribution])  ▪  (RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution])  ▪  (RefLink[MardiaCombinedTest, paclet:ref/MardiaCombinedTest])  ▪  (RefLink[VectorAround, paclet:ref/VectorAround])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Random Variables, paclet:guide/RandomVariables])}, {▪(RefLinkPlain[Parametric Statistical Distributions, paclet:guide/ParametricStatisticalDistributions])}, {▪(RefLinkPlain[Normal and Related Distributions, paclet:guide/NormalRelatedDistributions])}, {▪(RefLinkPlain[Distributions in Communication Systems, paclet:guide/DistributionsInCommunicationSystems])}})}})