Learn R Programming

BDgraph (version 2.33)

rgcwish: Sampling from complex G-Wishart distribution

Description

Generates random matrices, distributed according to the complex G-Wishart distribution with parameters b and D, \(CW_G(b, D)\).

Usage

rgcwish( n = 1, adj.g = NULL, b = 3, D = NULL )

Arguments

n
The number of samples required. The default value is 1.
adj.g
The adjacency matrix corresponding to the graph structure. It should be an upper triangular matrix in which \(a_{ij}=1\) if there is a link between notes \(i\) and \(j\), otherwise \(a_{ij}=0\).
b
The degree of freedom for complex G-Wishart distribution, \(CW_G(b, D)\). The default value is 3.
D
The positive definite \((p \times p)\) "scale" matrix for complex G-Wishart distribution, \(CW_G(b, D)\). The default is an identity matrix.

Value

A numeric array, say A, of dimension \((p \times p \times n)\), where each \(A[,,i]\) is a positive definite matrix, a realization of the complex G-Wishart distribution, \(CW_G(b, D)\).

Details

Sampling from the complex G-Wishart distribution, \(K \sim CW_G(b, D)\), with density: $$Pr(K) \propto |K| ^ {b} \exp \left\{- \mbox{trace}(K \times D)\right\},$$ which \(b > 2\) is the degree of freedom and D is a symmetric positive definite matrix.

References

Tank, A., N. Foti, and E. Fox (2015). Bayesian Structure Learning for Stationary Time Series, arXiv:1505.03131 Mohammadi, A. and E. Wit (2015). BDgraph: An R Package for Bayesian Structure Learning in Graphical Models, arXiv:1501.05108

Examples

Run this code
## Not run: ------------------------------------
# adj.g <- toeplitz( c( 0, 1, rep( 0, 3 ) ) )
# adj.g    # adjacency of graph with 5 nodes and 4 links
#    
# sample <- rgcwish( n = 3, adj.g = adj.g, b = 3, D = diag(5) )
# round( sample, 2 )  
## ---------------------------------------------

Run the code above in your browser using DataLab