data(braingraphs)
braingm <- getGibbsMixture(braingraphs, "adjMatrix", 5)
brainlm <- getLoglikeMixture(braingraphs, braingm)
brainlm
### By running the loglik mixture over several groups you can find which is the optimal
mixtures <- NULL
for(i in 1:5){
tempgm <- getGibbsMixture(braingraphs, "adjMatrix", i)
mixtures[i] <- getLoglikeMixture(braingraphs, tempgm)$bic
}
bestgroupnum <- which(min(mixtures) == mixtures)
bestgroupnum
Run the code above in your browser using DataLab