mcmc_asia | R Documentation |
mcmcabn
objects.10^5 MCMC runs with 1000 burn-in runs from the synthetic
asia
synthetic dataset. Used in examples and vignettes of the package mcmcabn.
mcmc.2par.asia
mcmc.4par.asia
The objects are of class mcmcabn
and rely on a cache of score computed using
buildScoreCache from the R package abn.
abnCache.4par.asia
,asia
## Compare the scores based on 4 and 2 parents:
plot(density(mcmc.4par.asia$scores))
lines(density(mcmc.2par.asia$scores), col = 2)
## Best scores do not match dags with 4 parents:
plot(mcmc.4par.asia$scores, type='l', col='gray')
maxpar <- apply(mcmc.4par.asia$dags, 3, function(x) max(rowSums(x)))
rug((1:1001)[maxpar==4], side = 3, col = 2)
## Not run:
## This data set was generated using the following code:
## (The following lines take some time to evaluate).
require(abn)
set.seed(3)
abnCache.4par.asia <- buildScoreCache(data.df = asia,
data.dists = dist.asia, max.parents = 4)
mcmc.4par.asia <- mcmcabn(score.cache = abnCache.4par.asia,
score = "mlik", data.dists = dist.asia, max.parents = 4,
mcmc.scheme = c(1000, 99, 1000), seed = 42, verbose = FALSE,
start.dag = "random", prob.rev = 0.03, prob.mbr = 0.03,
prior.choice = 2)
set.seed(3)
abnCache.2par.asia <- buildScoreCache(data.df = asia,
data.dists = dist.asia, max.parents = 2)
mcmc.2par.asia <- mcmcabn(score.cache = abnCache.2par.asia,
score = "mlik", data.dists = dist.asia, max.parents = 2,
mcmc.scheme = c(1000, 99, 1000), seed = 42, verbose = FALSE,
start.dag = "random", prob.rev = 0.03, prob.mbr = 0.03,
prior.choice = 2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.