Skip to contents

Perform simulations for prediction distribution plots

Usage

sg_predist_sim(
  fpath_i,
  gco = NULL,
  model = NULL,
  time_col = "TIME",
  outputs = NULL,
  npop = 500
)

Arguments

fpath_i

String, GFO, or a named list with a GFO component (and optionally GCO). If a string is given, the path to a .RData or .json file with a fit object is expected.

gco

Generalized control object (see GMO). Either an R list or path to Rdata/json file. Either gco or model should be specified for the simulation model specification. Default is NULL

model

GMO. RxODE2 model to simulate from.

time_col

String. The column to use as a time column. Currently, can be only TIME. Default is TIME.

outputs

Vector of strings. Names of the model variables to output. If NULL, all variables returned. Default is NULL.

npop

Integer. Number of population replicates. Default is 1.

Value

GSO: a data frame with simulation results.

Examples

# \donttest{
library(rxode2)
fpath_i <- system.file("extdata", "simurg_object", "Warfarin_PK.RData", package = "SimuRg")
#> Warning: cannot open compressed file '/tmp/RtmpLedq7K/temp_libpath8b6abff614d/SimuRg/DESCRIPTION', probable reason 'No such file or directory'
mod_fin <- rxode2({
 # Differential equations
 ka = ka_pop*exp(omega_ka)
 V = V_pop
 Cl = Cl_pop*exp(omega_Cl)
 d/dt(Ad) = -ka * Ad
 d/dt(Ac) = ka * Ad - Cl/V * Ac
 # Concentration calculations
 Cc = Ac / V
})
#>  
#>  
predist_sim <- sg_predist_sim(fpath_i, model = mod_fin, outputs = "Cc")
#> Error: cannot open file '/tmp/RtmpLedq7K/temp_libpath8b6abff614d/SimuRg/R/SimuRg.rdb': No such file or directory
predist_sim
#> Error: object 'predist_sim' not found
# }