if (FALSE) {
# 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( sample.ggm, data.sim, main = 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( list( sample.ggm, sample.gcgm ), data.sim,
main = c( "True", "GGM", "GCGM" ), vis = TRUE )
}
Run the code above in your browser using DataLab