View source: R/hoff_functions.R
rwish | R Documentation |
Simulate a Wishart-distributed random matrix.
rwish(S0, nu = dim(as.matrix(S0))[1] + 1)
S0 |
a positive definite matrix. |
nu |
a positive scalar. |
This function simulates a Wishart random matrix using Bartletts decomposition, as described in Everson and Morris (2000).
Peter Hoff.
# simulate several matrices and compute the mean. SS <- matrix(0, 5, 5) for(s in 1:1000) { SS <- SS + tensr:::rwish(diag(5), 3) } SS / s
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.