Run simulations
run_sim.RdRun simulations
Usage
run_sim(
fit = NULL,
data = NULL,
model = NULL,
id = irxutils::get_random_id("sim_"),
force = FALSE,
tool = c("auto", "nonmem", "nlmixr2"),
n_iterations = 1,
variables = NULL,
add_pk_variables = FALSE,
output_file = "simtab",
update_table = TRUE,
seed = 12345,
verbose = TRUE
)Arguments
- fit
a Pharmpy modelfit object.
- data
a NONMEM-format data.frame to use as the simulation dataset. Typically the output of
create_sim_dataset(). IfNULL, the dataset attached tomodelis used as-is.- model
either a Pharmpy model object, or a filename (for a model with NONMEM model code). If the latter,
run_sim()will attempt to load the model into Pharmpy first.- id
run id, e.g.
run1. This will be the folder in which the NONMEM model is run. If no folder is specified, it will create a folderrun1in the current working directory, and will increment the run number for each subsequent run.- force
if run folder (
id) exists, should existing results be removed before rerunning NONMEM? DefaultFALSE.- tool
the tool to run the model in, either
nonmem, ornlmixr.- n_iterations
number of iterations of the entire simulation to perform. The dataset for the simulation will stay the same between each iterations.
- variables
vector of variables to output. If
NULL, will output default variablesc("ID", "TIME", "DV", "EVID", "PRED")as well as all variables declared in the NONMEM code.- add_pk_variables
calculate basic PK variables: CMAX_OBS, TMAX_OBS, CMIN_OBS, and (when
CLis in the output table) AUC_SS. AUC_SS is derived as the last dose in the simulation dataset divided by CL.- output_file
TODO
- update_table
should any existing $TABLE records be removed, and a new
simtabbe created? This is default. IfFALSE, it will leave $TABLEs as specifed in the model. However, in the return object, only the first table is returned back. IfFALSE, theadd_pk_variablesargument will be ignored.- seed
TODO
- verbose
verbose output?