InverseWishartMatrixDistribution[ν,Σ]
represents an inverse Wishart matrix distribution with ν degrees of freedom and covariance matrix Σ.
InverseWishartMatrixDistribution
InverseWishartMatrixDistribution[ν,Σ]
represents an inverse Wishart matrix distribution with ν degrees of freedom and covariance matrix Σ.
Details
- The probability density for a symmetric matrix
in an inverse Wishart matrix distribution is proportional to
, where
is the size of matrix Σ. - For a matrix
distributed as InverseWishartMatrixDistribution[ν,Σ], the inverse
is distributed as WishartMatrixDistribution[ν,Σ-1]. - The covariance matrix
can be any positive definite symmetric matrix of dimensions
and ν can be any real number greater than
. - InverseWishartMatrixDistribution can be used with such functions as MatrixPropertyDistribution, EstimatedDistribution, and RandomVariate.
Examples
open all close allBasic Examples (3)
Generate a pseudorandom matrix:
RandomVariate[InverseWishartMatrixDistribution[10, {{1, 1 / 3}, {1 / 3, 1}}]]Check that it is positive definite:
PositiveDefiniteMatrixQ[%]Sample eigenvalues of an inverse Wishart random matrix using MatrixPropertyDistribution:
λ𝒟 = MatrixPropertyDistribution[RandomSample[Eigenvalues[x]], xInverseWishartMatrixDistribution[10, {{1, 1 / 3}, {1 / 3, 1}}]];SmoothHistogram3D[RandomVariate[λ𝒟, 10 ^ 4], PlotRange -> {{-.1, .5}, {-.1, .5}, Automatic}]Mean[InverseWishartMatrixDistribution[8, DiagonalMatrix[{2, 1, 3}]]]//MatrixFormVariance[InverseWishartMatrixDistribution[8, DiagonalMatrix[{2, 1, 3}]]]//MatrixFormScope (6)
Generate a single pseudorandom matrix:
RandomVariate[InverseWishartMatrixDistribution[10, {{1, 1 / 3}, {1 / 3, 1}}]]Generate a set of pseudorandom matrices:
MatrixForm /@ RandomVariate[InverseWishartMatrixDistribution[10, {{1, 1 / 3}, {1 / 3, 1}}], 3]RandomVariate[InverseWishartMatrixDistribution[10, {{1, 1 / 3}, {1 / 3, 1}}], WorkingPrecision -> 20]Compute statistical properties numerically:
λmax𝒟 = MatrixPropertyDistribution[Max[Eigenvalues[𝓂]], 𝓂InverseWishartMatrixDistribution[10, {{1, 1 / 3}, {1 / 3, 1}}]];Numerically approximate expectation of the largest matrix eigenvalue
:
NExpectation[λmax, λmaxλmax𝒟]Distribution parameters estimation:
dist = InverseWishartMatrixDistribution[3, IdentityMatrix[2]];
sample = RandomVariate[dist, 10 ^ 2];Estimate the distribution parameters from sample data:
edist = EstimatedDistribution[sample, InverseWishartMatrixDistribution[ν, Array[c, {2, 2}]]]Compare LogLikelihood for both distributions:
LogLikelihood[#, sample]& /@ {edist, dist}Skewness[InverseWishartMatrixDistribution[8, {{2, 1}, {1, 3}}]]//MatrixFormProperties & Relations (3)
, where
and
are independent Gaussian vector and Wishart matrix follows HotellingTSquareDistribution:
cov = {{1, 2 / 5}, {2 / 5, 1 / 2}};
n = 10;
t2dist = HotellingTSquareDistribution[Length[cov], n];Use MatrixPropertyDistribution to sample expressions
:
sample = RandomVariate[MatrixPropertyDistribution[n x.w.x, {wInverseWishartMatrixDistribution[n, Inverse[cov]], xMultinormalDistribution[{0, 0}, cov]}], 10 ^ 4];DistributionFitTest[sample, t2dist]Show[Histogram[sample, Automatic, PDF], Plot[PDF[t2dist, x], {x, 0, 12}]]Any diagonal element of inverse Wishart random matrix follows scaled inverse χ2 distribution:
n = 10;
des = RandomVariate[MatrixPropertyDistribution[Diagonal[m], mInverseWishartMatrixDistribution[n, {{1, 4 / 5}, {4 / 5, 1}}]], 10 ^ 4];DistributionFitTest[des[[All, 1]], InverseChiSquareDistribution[n - 1]]DistributionFitTest[des[[All, 2]], InverseChiSquareDistribution[n - 1]]Diagonal elements are not independent:
ListPlot[des, PlotRange -> {{0, 1}, {0, 1}}]IndependenceTest[des[[All, 1]], des[[All, 2]], "TestConclusion"]For any nonzero vector
and inverse Wishart matrix
with scale matrix
,
is χ2 distributed:
Σ = {{1, 4 / 5}, {4 / 5, 1}};
n = 10.3;
y = # / Sqrt[#.Σ.#]&[RandomReal[1, 2]];
data = RandomVariate[MatrixPropertyDistribution[y.Inverse[w].y, wInverseWishartMatrixDistribution[n, Inverse[Σ]]], 10 ^ 4];DistributionFitTest[data, ChiSquareDistribution[n]]Show[Histogram[data, Automatic, PDF], Plot[PDF[ChiSquareDistribution[n], x], {x, 0, 30}]]Related Guides
Text
Wolfram Research (2015), InverseWishartMatrixDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/InverseWishartMatrixDistribution.html (updated 2017).
CMS
Wolfram Language. 2015. "InverseWishartMatrixDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/InverseWishartMatrixDistribution.html.
APA
Wolfram Language. (2015). InverseWishartMatrixDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/InverseWishartMatrixDistribution.html
BibTeX
@misc{reference.wolfram_2026_inversewishartmatrixdistribution, author="Wolfram Research", title="{InverseWishartMatrixDistribution}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/InverseWishartMatrixDistribution.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_inversewishartmatrixdistribution, organization={Wolfram Research}, title={InverseWishartMatrixDistribution}, year={2017}, url={https://reference.wolfram.com/language/ref/InverseWishartMatrixDistribution.html}, note=[Accessed: 13-June-2026]}