
Last chance! 50% off unlimited learning
Sale ends in
bdgraph( data, n = NULL, method = "ggm", algorithm = "bdmcmc", iter = 5000,
burnin = iter / 2, g.start = "empty", prior.df = 3,
multi.update = NULL, save.all = FALSE )
data.frame
corresponding to the data,
(2) an ($p \times p$) covariance matrix as $S=X'X$ which $X$ is the data matrix
($n$ is the sample size and $p$ is the number of variables). "data"
is a covariance matrix."ggm"
(defult) and "gcgm"
.
Option "ggm"
is for Gaussian graphical models based on Gaussianity assumption.
Option "gcgm"
is for Gaussian copula graphical models for the"bdmcmc"
(defult) and "rjmcmc"
.
Option "bdmcmc"
is based on birth-death MCMC algorithm.
Option "rjmcmc"
is based on reverible jump MCMC algorithm."empty"
(default) and "full"
.
Option "empty"
means the initial graph is an empty graph and "full"
means a full graph.
It also could be analgorithm = "bdmcmc"
).
It is for simultaneously updating multiple links at the same time to update graph in the BDMCMC algorithm.S3
class "bdgraph"
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.sim
, summary.bdgraph
, and compare
# Generating multivariate normal data from a 'random' graph
data.sim <- bdgraph.sim( n = 20, p = 6, size = 7, vis = TRUE )
bdgraph.obj <- bdgraph( data = data.sim, iter = 1000 )
summary( bdgraph.obj )
# To compare our result with true graph
compare( data.sim, bdgraph.obj, colnames = c("True graph", "BDgraph") )
# Running algorithm with starting points from previous run
bdgraph.obj2 <- bdgraph( data = data.sim, iter = 5000, g.start = bdgraph.obj )
compare( data.sim, bdgraph.obj, bdgraph.obj2,
colnames = c( "True graph", "Frist run", "Second run" ) )
# Generating mixed data from a 'scale-free' graph
data.sim <- bdgraph.sim( n = 50, p = 6, type = "mixed", graph = "scale-free", vis = TRUE )
bdgraph.obj <- bdgraph( data = data.sim, method = "gcgm", iter = 10000 )
summary( bdgraph.obj )
compare( data.sim, bdgraph.obj )
Run the code above in your browser using DataLab