parallel_mrgsim_d: Simulate a data set in parallel

parallel_mrgsim_dR Documentation

Simulate a data set in parallel

Description

Use future_mrgsim_d() to simulate with the future package. Use mc_mrgsim_d() to simulate with parallel::mclapply.

Usage

future_mrgsim_d(
  mod,
  data,
  nchunk = 4,
  ...,
  .as_list = FALSE,
  .p = NULL,
  .dry = FALSE,
  .seed = TRUE,
  .parallel = TRUE
)

mc_mrgsim_d(
  mod,
  data,
  nchunk = 4,
  ...,
  .as_list = FALSE,
  .p = NULL,
  .dry = FALSE,
  .seed = NULL,
  .parallel = TRUE
)

fu_mrgsim_d(
  mod,
  data,
  nchunk = 4,
  ...,
  .as_list = FALSE,
  .p = NULL,
  .dry = FALSE,
  .seed = TRUE,
  .parallel = TRUE
)

fu_mrgsim_d0(..., .dry = TRUE)

Arguments

mod

The mrgsolve model object see mrgsolve::mrgmod.

data

Data set to simulate; see mrgsolve::data_set().

nchunk

Number of chunks in which to split the data set

...

Passed to mrgsim_d().

.as_list

If TRUE a list is return; otherwise (default) a data frame

.p

Post processing function executed on the worker; arguments should be (1) the simulated output (2) the model object.

.dry

If TRUE neither the simulation nor the post processing will be done.

.seed

Passed to future_lapply() as future.seed.

.parallel

if FALSE, the simulation will not be parallelized; this is intended for debugging and testing use only.

Value

A data frame or list of simulated data.

See Also

future_mrgsim_ei()

Examples


mod <- mrgsolve::house()

data <- mrgsolve::expand.ev(amt = seq(10))

out <- future_mrgsim_d(mod, data, nchunk = 2)


mrgsim.parallel documentation built on March 18, 2022, 7:52 p.m.