# NOT RUN {
# Generating multivariate normal data from a 'random' graph
data.sim <- bdgraph.sim( n = 50, p = 6, size = 7, vis = TRUE )
# Running sampling algorithm based on GGMs
sample.ggm <- bdgraph( data = data.sim, method = "ggm", iter = 10000 )
# Comparing the results
compare( data.sim, sample.ggm, colnames = c( "True", "GGM" ), vis = TRUE )
# Running sampling algorithm based on GCGMs
sample.gcgm <- bdgraph( data = data.sim, method = "gcgm", iter = 10000 )
# Comparing GGM and GCGM methods
compare( data.sim, sample.ggm, sample.gcgm, colnames = c("True", "GGM", "GCGM"), vis = TRUE )
# }
Run the code above in your browser using DataLab