bdgraph.sim {BDgraph}  R Documentation 
Simulating multivariate distributions with different types of underlying graph structures, including
"random"
, "cluster"
, "scalefree"
, "lattice"
, "hub"
, "star"
, "circle"
, "AR(1)"
, and "AR(2)"
.
Based on the underling graph structure, it generates different types of multivariate data, including multivariate Gaussian, nonGaussian, count, mixed, binary, or discrete Weibull data.
This function can be used also for only simulating graphs by option n=0
, as a default.
bdgraph.sim( p = 10, graph = "random", n = 0, type = "Gaussian", prob = 0.2, size = NULL, mean = 0, class = NULL, cut = 4, b = 3, D = diag( p ), K = NULL, sigma = NULL, q = exp(1), beta = 1, vis = FALSE )
p 
The number of variables (nodes). 
graph 
The graph structure with options

n 
The number of samples required. Note that for the case 
type 
Type of data with four options 
prob 
If 
size 
The number of links in the true graph (graph size). 
mean 
A vector specifies the mean of the variables. 
class 
If 
cut 
If 
b 
The degree of freedom for GWishart distribution, W_G(b, D). 
D 
The positive definite (p \times p) "scale" matrix for GWishart distribution, W_G(b, D). The default is an identity matrix. 
K 
If 
sigma 
If 
q, beta 
If p(x,q,β) = q^{x^{β}}q^{(x+1)^{β}}, \quad \forall x = \{ 0, 1, 2, … \}. 
vis 
Visualize the true graph structure. 
An object with S3
class "sim"
is returned:
data 
Generated data as an (n x p) matrix. 
sigma 
The covariance matrix of the generated data. 
K 
The precision matrix of the generated data. 
G 
The adjacency matrix corresponding to the true graph structure. 
Reza Mohammadi a.mohammadi@uva.nl, Pariya Behrouzi, Veronica Vinciotti, and Ernst Wit
Mohammadi, R. and Wit, E. C. (2019). BDgraph: An R
Package for Bayesian Structure Learning in Graphical Models, Journal of Statistical Software, 89(3):130
Mohammadi, A. and Wit, E. C. (2015). Bayesian Structure Learning in Sparse Gaussian Graphical Models, Bayesian Analysis, 10(1):109138
Mohammadi, A. et al (2017). Bayesian modelling of Dupuytren disease by using Gaussian copula graphical models, Journal of the Royal Statistical Society: Series C, 66(3):629645
Dobra, A. and Mohammadi, R. (2018). Loglinear Model Selection and Human Mobility, Annals of Applied Statistics, 12(2):815845
Letac, G., Massam, H. and Mohammadi, R. (2018). The Ratio of Normalizing Constants for Bayesian Graphical Gaussian Model Selection, arXiv preprint arXiv:1706.04416v2
Pensar, J. et al (2017) Marginal pseudolikelihood learning of discrete Markov network structures, Bayesian Analysis, 12(4):1195215
graph.sim
, bdgraph
, bdgraph.mpl
## Not run: # Generating multivariate normal data from a 'random' graph data.sim < bdgraph.sim( p = 10, n = 50, prob = 0.3, vis = TRUE ) print( data.sim ) # Generating multivariate normal data from a 'hub' graph data.sim < bdgraph.sim( p = 6, n = 3, graph = "hub", vis = FALSE ) round( data.sim $ data, 2 ) # Generating mixed data from a 'hub' graph data.sim < bdgraph.sim( p = 8, n = 10, graph = "hub", type = "mixed" ) round( data.sim $ data, 2 ) # Generating only a 'scalefree' graph (with no data) graph.sim < bdgraph.sim( p = 8, graph = "scalefree" ) plot( graph.sim ) graph.sim $ G ## End(Not run)