# generating multivariate normal data from a 'random' graph
data.sim <- bdgraph.sim( n = 50, p = 6, size = 7, vis = TRUE )
# running sampling algorithm
output <- bdgraph( data = data.sim, iter = 10000 )
# comparing the result
compare( data.sim, output, colnames = c("true", "BDgraph"), vis = TRUE )
# estimate the true graph by 'huge' package
require( huge )
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") , vis = TRUE )
Run the code above in your browser using DataLab