# generating the data from a random graph
data.sim <- bdgraph.sim(n = 100, p = 8, size = 9, vis = TRUE)
# selecting the best graph according to BD-MCMC algorithm
output <- bdgraph(data.sim, mean = 0, iter = 5000)
# comparing the result
compare(data.sim, output, colnames = c("true", "BDgraph"), vis = TRUE)
# selecting the best graph by huge package
huge.g <- huge(data.sim $ data, method = "mb")
huge.g <- huge.select(huge.g)
# comparing the result
compare(data.sim, output, huge.g, colnames = c("true", "BDgraph", "huge"))
Run the code above in your browser using DataLab