rwishart | R Documentation |
This function draws from a Wishart and inverted Wishart distribution.
rwishart(nu, V)
nu |
A numeric, the degrees of freedom. Must be at least the number of dimensions. |
V |
A matrix, the scale matrix. |
The Wishart distribution is a generalization to multiple dimensions of the
gamma distributions and draws from the space of covariance matrices.
Its expectation is nu*V
and its variance increases both in nu
and in the values of V
.
The Wishart distribution is the conjugate prior to the precision matrix of
a multivariate normal distribution and proper if nu
is greater than
the number of dimensions.
A list, the draws from the Wishart (W
), inverted Wishart (IW
), and
corresponding Choleski decomposition (C
and CI
).
rwishart(nu = 2, V = diag(2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.