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)
# To compute the value of MSE
mse(pred = sample.ggm, actual = data.sim)
# To compute the value of weighted MSE
mse(pred = sample.ggm, actual = data.sim, weight = 0.5)
}
Run the code above in your browser using DataLab