Description Usage Arguments Value Examples
Initializes a MultiBatchPooled model, a container for storing data, parameters, and MCMC output for mixture models with batch- and component-specific means. The variance is assumed to be the same for all components, but allowed to differ by batch.
1 2 3 | MBP(dat = numeric(), hp = HyperparametersMultiBatch(),
mp = McmcParams(iter = 1000, burnin = 1000, thin = 10, nStarts = 4),
batches = integer())
|
dat |
the data for the simulation. |
hp |
An object of class 'Hyperparameters' used to specify the hyperparameters of the model. |
mp |
An object of class 'McmcParams' |
batches |
an integer-vector of the different batches |
An object of class 'MultiBatchPooled'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | model <- MBP(rnorm(10), batch=rep(1L, 10))
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 = 2500,
batch = rep(letters[1:3],
length.out = 2500),
theta = means, sds = sds,
p = c(1/5, 1/3, 1 - 1/3 - 1/5))
MBP(dat=y(truth), batches=batch(truth),
hp=hpList(k=3)[["MB"]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.