# Wishart

## Wishart(cv, n, I, J)

The Wishart multivariate distribution describes a probability distribution over scatter matrices arising data sampled from a Gaussian distribution. Each sample from a Wishart is a 2-dimensional square, positive-definite, symmetric matrix. Suppose you sample `N`

samples from a Gaussian(0, cv, I, J) distribution, `X[I, R]`

. (`R`

is the index that indexes each sample, `R := 1..N`

). The Wishart distribution describes the distribution of `Sum(X*X[I = J], R)`

. This matrix is dimensioned by `I`

and `J`

and is called the scatter matrix. The parameter «cv» must be positive-definite.

A sample drawn from the Wishart is therefore a sample scatter matrix. If you divide that sample by `(N - 1)`

, you have a sampled covariance matrix.

If you compute a sample covariance matrix from data, and then want to use this in your model, if you just use it directly, you'll be ignoring sampling error. That may be insignificant of `N`

is large. Otherwise, you may want to use:

`Wishart(SampleCV, N, I, J)/(N - 1)`

instead of just `SampleCV`

in your model. The extended variance will account for the uncertainty from the finite sample size that was used to obtain your sample CV.

If you can express a prior probability on covariances in the form of an InvertedWishart distribution, then the posterior distribution, after having computed the sample covariance matrix (assumed to be drawn, by nature, from a Wishart), is also an InvertedWishart.

The Wishart can be viewed as a generalization of ChiSquared. When Size(I) = 1, the Wishart becomes a ChiSquared distribution.

## Library

Distribution Variations library (Distribution Variations.ana)

- Use
**File → Add Library...**to add this library

Enable comment auto-refresher