mcmc_asia: Precomputed 'mcmcabn' objects.

mcmc_asiaR Documentation

Precomputed mcmcabn objects.

Description

10^5 MCMC runs with 1000 burn-in runs from the synthetic asia synthetic dataset. Used in examples and vignettes of the package mcmcabn.

Usage

mcmc.2par.asia
mcmc.4par.asia

Format

The objects are of class mcmcabn and rely on a cache of score computed using buildScoreCache from the R package abn.

See Also

abnCache.4par.asia,asia

Examples

## 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)



mcmcabn documentation built on Sept. 28, 2023, 5:08 p.m.