rCholWishart {CholWishart} | R Documentation |
Generate n random matrices, distributed according
to the Cholesky factorization of a Wishart distribution with
parameters Sigma
and df
, W_p(Sigma, df)
(known as the Bartlett decomposition
in the context of Wishart random matrices).
rCholWishart(n, df, Sigma)
n |
integer sample size. |
df |
numeric parameter, "degrees of freedom". |
Sigma |
positive definite (p * p) "scale" matrix, the matrix parameter of the distribution. |
a numeric array, say R
, of dimension p * p * n,
where each R[,,i]
is a Cholesky decomposition of a sample
from the Wishart distribution W_p(Sigma, df). Based on a
modification of the existing code for the rWishart
function.
Anderson, T. W. (2003). An Introduction to Multivariate Statistical Analysis (3rd ed.). Hoboken, N. J.: Wiley Interscience.
Mardia, K. V., J. T. Kent, and J. M. Bibby (1979) Multivariate Analysis, London: Academic Press.
A. K. Gupta and D. K. Nagar 1999. Matrix variate distributions. Chapman and Hall.
# How it is parameterized: set.seed(20180211) A <- rCholWishart(1,10,3*diag(5))[,,1] A set.seed(20180211) B <- rInvCholWishart(1,10,1/3*diag(5))[,,1] B crossprod(A) %*% crossprod(B) set.seed(20180211) C <- chol(stats::rWishart(1,10,3*diag(5))[,,1]) C