if (FALSE) {
## Use a subset of a built-in simulated data set
mydat <- ex1.dag.data[,c("b1","g1","p1")]
## setup distribution list for each node
mydists <- list(b1="binomial", g1="gaussian", p1="poisson")
## now build cache
mycache <- buildScoreCache(data.df = mydat, data.dists = mydists, max.parents = 2, method = "mle")
## Find the globally best DAG
mp.dag <- mostProbable(score.cache=mycache, score="bic", verbose = FALSE)
out <- scoreContribution(object = mp.dag)
## Observations contribution per network node
boxplot(out$bic)
}
Run the code above in your browser using DataLab