parallel_mrgsim_ei {mrgsim.parallel} | R Documentation |
Simulate an idata set in parallel
Description
Use future_mrgsim_ei to simulate with the future
package. Use
mc_mrgsim_ei to simulate with parallel::mclapply
.
Usage
future_mrgsim_ei(
mod,
events,
idata,
nchunk = 4,
...,
.as_list = FALSE,
.p = NULL,
.dry = FALSE,
.seed = TRUE,
.parallel = TRUE
)
fu_mrgsim_ei(
mod,
events,
idata,
nchunk = 4,
...,
.as_list = FALSE,
.p = NULL,
.dry = FALSE,
.seed = TRUE,
.parallel = TRUE
)
fu_mrgsim_ei0(..., .dry = TRUE)
mc_mrgsim_ei(
mod,
events,
idata,
nchunk = 4,
...,
.as_list = FALSE,
.p = NULL,
.dry = FALSE,
.seed = NULL,
.parallel = TRUE
)
Arguments
mod |
The mrgsolve model object see mrgsolve::mrgmod. |
events |
An event object from mrgsolve; see |
idata |
An idata set of parameters, one per simulation unit (individual);
see |
nchunk |
Number of chunks in which to split the data set |
... |
Passed to |
.as_list |
If |
.p |
Post processing function executed on the worker; arguments should be (1) the simulated output (2) the model object. |
.dry |
If |
.seed |
Passed to |
.parallel |
if |
Value
A data frame or list of simulated data.
See Also
Examples
mod <- mrgsolve::house()
events <- mrgsolve::ev(amt = 100)
idata <- data.frame(CL = runif(10, 0.5, 1.5))
out <- future_mrgsim_ei(mod, events, idata)