ipd.run.parallel {bipd}R Documentation

Run the model using the ipd object with parallel computation

Description

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.

Usage

ipd.run.parallel(
  ipd,
  pars.save = NULL,
  inits = NULL,
  n.chains = 2,
  n.adapt = 1000,
  n.burnin = 1000,
  n.iter = 10000
)

Arguments

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

Value

MCMC samples stored using JAGS. The returned samples have the form of mcmc.list and coda functions can be directly applied.

Examples

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)


[Package bipd version 0.3 Index]