Last chance! 50% off unlimited learning
Sale ends in
"random"
, "cluster"
, "scale-free"
, "hub"
, "fixed"
, and "circle"
.
Based on the underling graph structure, it generates four different types of datasets, including multivariate Gaussian, non-Gaussian, discrete, or mixed data.bdgraph.sim( n = 2, p = 10, type = "Gaussian", graph = "random", prob = 0.2,
size = NULL, mean = 0, class = NULL, cut = 4, b = 3,
D = diag(p), K = NULL, sigma = NULL, vis = FALSE )
"Gaussian"
(as a default), "non-Gaussian"
, "discrete"
, and "mixed"
.
For option "Gaussian"
, data are generated from multivariate normal distribution.
Fo"random"
(default), "cluster"
, "scale-free"
, "hub"
, "fixed"
, and "circle"
.
It also could be an adjacency matrix corresponding to a graph sgraph="random"
, it is the probability that a pair of nodes has a link. The default value is 0.2.graph="cluster"
, it is the number of classes.type="discrete"
, it is the number of categories for simulating discrete data. The default value is 4.graph="fixed"
, it is a positive-definite symmetric matrix specifies as a true precision matrix.graph="fixed"
, it is a positive-definite symmetric matrix specifies as a true covariance matrix.S3
class "sim"
is returned:R
Package for Bayesian Structure Learning in Graphical Models, arXiv:1501.05108
Mohammadi, A., F. Abegaz Yazew, E. van den Heuvel, and E. Wit (2015). Bayesian Gaussian Copula Graphical Modeling for Dupuytren Disease, arXiv:1501.04849bdgraph
# Generating multivariate normal data from a 'random' graph
data.sim <- bdgraph.sim( n = 50, p = 10, prob = 0.3, vis = TRUE )
print( data.sim )
# Generating multivariate normal data from a 'hub' graph
data.sim <- bdgraph.sim( n = 3, p = 6, graph = "hub", vis = FALSE )
round( data.sim $ data, 2 )
# Generating mixed data from a 'hub' graph
data.sim <- bdgraph.sim( n = 10, p = 8, graph = "hub", type = "mixed" )
round( data.sim $ data, 2 )
Run the code above in your browser using DataLab