gibbs_pooled {CNPBayes} | R Documentation |
Evaluate both single-batch and multi-batch models with the specified range for the number of components, returning the top models sorted by marginal likelihood
gibbs_pooled(hp.list, mp, dat, batches, k_range = c(1, 4), max_burnin = 32000, top = 3)
hp.list |
a list of hyperparameters. See example. |
mp |
a |
dat |
numeric vector of CNP summary statistics (e.g., median log R ratios) |
batches |
an integer vector of the same length as the data providing an index for the batch |
k_range |
a length-two integer vector providing the minimum and maximum number of components |
max_burnin |
a length-one integer vector indicating the maximum number of burnin iterations |
top |
the number of models to return after ordering by the marginal likelihood |
a list of models
set.seed(100) nbatch <- 3 k <- 3 means <- matrix(c(-2.1, -2, -1.95, -0.41, -0.4, -0.395, -0.1, 0, 0.05), nbatch, k, byrow = FALSE) sds <- matrix(0.15, nbatch, k) sds[, 1] <- 0.3 N <- 1000 truth <- simulateBatchData(N = N, batch = rep(letters[1:3], length.out = N), p = c(1/10, 1/5, 1 - 0.1 - 0.2), theta = means, sds = sds) hp <- HyperparametersMultiBatch(k=3, mu=-0.75, tau2.0=0.4, eta.0=32, m2.0=0.5) hp.sb <- Hyperparameters(tau2.0=0.4, mu.0=-0.75, eta.0=32, m2.0=0.5) hp.list <- list(single_batch=hp.sb, multi_batch=hp) mp <- McmcParams(iter = 1000, burnin = 1000, nStarts = 4, thin=10) ## Not run: models <- gibbs_pooled(hp.list=hp.list, dat=y(truth), batches=batch(truth), mp=mp, top=3) ## End(Not run)