rgcwish {BDgraph} | R Documentation |
Generates random matrices, distributed according to the complex G-Wishart distribution with parameters b and D, CW_G(b, D).
rgcwish( n = 1, adj = NULL, b = 3, D = NULL )
n |
The number of samples required. |
adj |
The adjacency matrix corresponding to the graph structure which can be non-decomposable or decomposable. 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). |
D |
The positive definite (p \times p) "scale" matrix for complex G-Wishart distribution, CW_G(b, D). The default is an identity matrix. |
Sampling from the complex G-Wishart distribution, K \sim CW_G(b, D), with density:
Pr(K) \propto |K| ^ {b} \exp ≤ft\{- \mbox{trace}(K \times D)\right\},
which b > 2 is the degree of freedom and D is a symmetric positive definite matrix.
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).
Lang Liu, Nicholas Foti, Alex Tank and Reza Mohammadi a.mohammadi@uva.nl
Tank, A., Foti, N., and Fox, E. (2015). Bayesian Structure Learning for Stationary Time Series, arXiv preprint arXiv:1505.03131
Mohammadi, R. and Wit, E. C. (2019). BDgraph: An R
Package for Bayesian Structure Learning in Graphical Models, Journal of Statistical Software, 89(3):1-30
## Not run: # Generating a 'circle' graph as a non-decomposable graph adj <- graph.sim( p = 5, graph = "circle" ) adj # adjacency of graph with 5 nodes sample <- rgcwish( n = 3, adj = adj, b = 3, D = diag( 5 ) ) round( sample, 2 ) ## End(Not run)