rmatrixgamma {matrixsampling} | R Documentation |
Matrix Gamma sampler
Description
Samples a matrix Gamma distribution.
Usage
rmatrixgamma(n, nu, theta, Sigma = NULL, p, checkSymmetry = TRUE)
Arguments
n |
sample size, a positive integer |
nu |
shape parameter, a positive number; if |
theta |
scale parameter, a positive number |
Sigma |
scale matrix, a symmetric positive definite matrix, or
|
p |
if |
checkSymmetry |
logical, whether to check that |
Details
This is the distribution of θ/2×S where S ~ Wp(2ν,Σ).
Value
A numeric three-dimensional array; simulations are stacked along the third dimension.
References
Gupta & al. Properties of Matrix Variate Confluent Hypergeometric Function Distribution. Journal of Probability and Statistics vol. 2016, Article ID 2374907, 12 pages, 2016.
Examples
nu <- 3; theta <- 4; Sigma <- toeplitz(2:1)
Gsims <- rmatrixgamma(10000, nu, theta, Sigma)
apply(Gsims, c(1,2), mean) # should be nu * theta * Sigma
nu * theta * Sigma