kmbayes_parallel {bkmrhat}R Documentation

Run multiple BKMR chains in parallel

Description

Fit parallel chains from the kmbayes function. These chains leverage parallel processing from the future package, which can speed fitting and enable diagnostics that rely on multiple Markov chains from dispersed initial values.

Usage

kmbayes_parallel(nchains = 4, ...)

Arguments

nchains

number of parallel chains

...

arguments to kmbayes

Value

a "bkmrfit.list" object, which is just an R list object in which each entry is a "bkmrfit" object kmbayes

Examples


set.seed(111)
dat <- bkmr::SimData(n = 50, M = 4)
y <- dat$y
Z <- dat$Z
X <- dat$X
set.seed(111)

future::plan(strategy = future::multisession, workers=2)
# only 50 iterations fit to save installation time
fitkm.list <- kmbayes_parallel(nchains=2, y = y, Z = Z, X = X, iter = 50,
  verbose = FALSE, varsel = TRUE)
closeAllConnections()


[Package bkmrhat version 1.1.1 Index]