# rWishart

0th

Percentile

##### Random Wishart Distributed Matrices

Generate n random matrices, distributed according to the Wishart distribution with parameters Sigma and df, $W_p(\Sigma, m),\ m=\code{df},\ \Sigma=\code{Sigma}$.

Keywords
multivariate
##### Usage
rWishart(n, df, Sigma)
##### Arguments
n
integer sample size.
df
numeric parameter, degrees of freedom.
Sigma
positive definite ($p\times p$) scale matrix, the matrix parameter of the distribution.
##### Details

If $X_1,\dots, X_m, \ X_i\in\mathbf{R}^p$ is a sample of $m$ independent multivariate Gaussians with mean (vector) 0, and covariance matrix $\Sigma$, the distribution of $M = X'X$ is $W_p(\Sigma, m)$.

Consequently, the expectation of $M$ is $$E[M] = m\times\Sigma.$$ Further, if Sigma is scalar ($p = 1$), the Wishart distribution is a scaled chi-squared ($\chi^2$) distribution with df degrees of freedom, $W_1(\sigma^2, m) = \sigma^2 \chi^2_m$.

The component wise variance is $$\mathrm{Var}(M_{ij}) = m(\Sigma_{ij}^2 + \Sigma_{ii} \Sigma_{jj}).$$

##### Value

• a numeric array, say R, of dimension $p \times p \times n$, where each R[,,i] is a positive definite matrix, a realization of the Wishart distribution $W_p(\Sigma, m),\ \ m=\code{df},\ \Sigma=\code{Sigma}$.

##### References

Mardia, K. V., J. T. Kent, and J. M. Bibby (1979) Multivariate Analysis, London: Academic Press.