Usage
MCMC.parallel(p, n, init, n.chain = 4, n.cpu, packages = NULL, dyn.libs=NULL,
scale = rep(1, length(init)), log = TRUE, adapt = !is.null(acc.rate),
acc.rate = NULL, gamma = 0.55, list = FALSE, ...)
Arguments
p
function that returns the (log) probability density to sample from. Must have two or more dimensions.
init
vector with initial values.
n.chain
number of independent chains.
n.cpu
number of CPUs that should be used in parallel.
packages
vector with name of packages to load into each instance. (Typically,
all packages on which p
depends.)
dyn.libs
vector with name of dynamic link libraries (shared objects) to load into each
instance. The libraries must be located in the working directory.
scale
vector with the variances or covariance matrix of the jump distribution.
log
logical. If TRUE
, a log density is expected from p
(strongly recommended).
adapt
if TRUE
, adaptive sampling is used, if FALSE
classic metropolis
sampling, if a positive integer the adaption stops after adapt
iterations.
acc.rate
desired acceptance rate (ignored if adapt=FALSE
)
gamma
controls the speed of adaption. Should be between 0.5 and 1. A lower
gamma leads to faster adaption.
list
logical. If TRUE
a list of lits is returned otherwise a list of matrices with the samples.
...
further arguments passed to p