# Generating multivariate normal data from a 'random' graph
data.sim <- bdgraph.sim( n = 50, p = 6, size = 6, vis = TRUE )
output <- bdgraph( data = data.sim, save.all = TRUE )
# Estimated posterior probability of the true graph
prob( output, G = data.sim )
# Estimated posterior probability of the first and second graphs with highest probabilities
prob( output, number.g = 2 )
Run the code above in your browser using DataLab