rmatrixgamma: Matrix Gamma sampler

Description Usage Arguments Details Value References Examples

View source: R/gamma.R

Description

Samples a matrix Gamma distribution.

Usage

1
rmatrixgamma(n, nu, theta, Sigma = NULL, p, checkSymmetry = TRUE)

Arguments

n

sample size, a positive integer

nu

shape parameter, a positive number; if nu < (p-1)/2, where p is the dimension (the order of Sigma), then nu must be a half integer

theta

scale parameter, a positive number

Sigma

scale matrix, a symmetric positive definite matrix, or NULL for the identity matrix of order p

p

if Sigma is NULL, this sets Sigma to the identity matrix of order p; ignored if Sigma is not NULL

checkSymmetry

logical, whether to check that Sigma is a symmetric positive definite matrix

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

1
2
3
4
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

matrixsampling documentation built on Aug. 25, 2019, 1:03 a.m.