ipd.run.parallel | R Documentation |
This function runs the model through parallel computation using dclone R package. Before running this function, we need to specify data, prior, JAGS code, etc. using ipd.model type function.
ipd.run.parallel( ipd, pars.save = NULL, inits = NULL, n.chains = 2, n.adapt = 1000, n.burnin = 1000, n.iter = 10000 )
ipd |
ipd object created from ipd.model type function |
pars.save |
parameters to save. For instance, "beta" - coefficients for main effects; "gamma" - coefficients for effect modifiers; "delta" - average treatment effect |
inits |
initial values specified for the parameters to save |
n.chains |
number of MCMC chains to sample |
n.adapt |
number of iterations for adaptation (Note that the samples from adaptation phase is non-Markovian and do not constitute a Markov chain) |
n.burnin |
number of iterations for burn-in |
n.iter |
number of iterations to run after the adaptation |
MCMC samples stored using JAGS. The returned samples have the form of mcmc.list and coda functions can be directly applied.
ds <- generate_ipdma_example(type = "continuous") ipd <- with(ds, ipdma.model.onestage(y = y, study = studyid, treat = treat, X = cbind(z1, z2), response = "normal", shrinkage = "none")) samples <- ipd.run.parallel(ipd, n.chains = 2, n.burnin = 500, n.iter = 5000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.