if (FALSE) {
edge_list <- matrix(numeric(),ncol=2)
net <- new(UndirectedNet,edge_list,5)
rcpp_model <- createCppModel(net ~ edges(), theta = 0)
rcpp_sampler <- new(UndirectedMetropolisHastings, rcpp_model)
# Run MCMC to generate 30 networks with burnin=10 and an interval of 20 steps between each network
networks <- rcpp_sampler$generateSample(10,20,30)
sapply(networks, function(net) net$nEdges()) # number of edges in each network
}
Run the code above in your browser using DataLab