Description Usage Arguments Details Value Author(s) References Examples

Generates random matrices, distributed according to the G-Wishart distribution with parameters b and D, *W_G(b, D)* with respect to the graph structure *G*.
Note this fuction works for both non-decomposable and decomposable graphs.

1 |

`n` |
The number of samples required. |

`adj.g` |
The adjacency matrix corresponding to the graph structure which can be non-decomposable or decomposable. It should be an upper triangular matrix in which |

`b` |
The degree of freedom for G-Wishart distribution, |

`D` |
The positive definite |

Sampling from G-Wishart distribution, *K \sim W_G(b, D)*, with density:

*Pr(K) \propto |K| ^ {(b - 2) / 2} \exp ≤ft\{- \frac{1}{2} \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 G-Wishart distribution, *W_G(b, D)*.
Note, for the case *n=1*, the output is a matrix.

Reza Mohammadi

Lenkoski, A. (2013). A direct sampler for G-Wishart variates, *Stat*, 2:119-128

Mohammadi, A. and E. Wit (2015). Bayesian Structure Learning in Sparse Gaussian Graphical Models, *Bayesian Analysis*, 10(1):109-138

Mohammadi, A. and E. Wit (2015). BDgraph: An `R`

Package for Bayesian Structure Learning in Graphical Models, *arXiv preprint arXiv:1501.05108*

Mohammadi, A. et al (2017). Bayesian modelling of Dupuytren disease by using Gaussian copula graphical models, *Journal of the Royal Statistical Society: Series C*

Mohammadi, A., Massam H., and G. Letac (2017). The Ratio of Normalizing Constants for Bayesian Graphical Gaussian Model Selection, *arXiv preprint arXiv:1706.04416*

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
## Not run:
# Generating a 'circle' graph as a non-decomposable graph
adj.g <- graph.sim( p = 5, graph = "circle" )
adj.g # adjacency of graph with 5 nodes
sample <- rgwish( n = 1, adj.g = adj.g, b = 3, D = diag( 5 ) )
round( sample, 2 )
sample <- rgwish( n = 5, adj.g = adj.g, b = 3, D = diag( 5 ) )
round( sample, 2 )
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.