diff --git a/articles/error_files/figure-html/example-1.png b/articles/error_files/figure-html/example-1.png index 4b8375f2..2d74b5f8 100644 Binary files a/articles/error_files/figure-html/example-1.png and b/articles/error_files/figure-html/example-1.png differ diff --git a/articles/error_files/figure-html/example-2-1.png b/articles/error_files/figure-html/example-2-1.png index ad8845fc..fffff373 100644 Binary files a/articles/error_files/figure-html/example-2-1.png and b/articles/error_files/figure-html/example-2-1.png differ diff --git a/articles/estimation-nlmixr.html b/articles/estimation-nlmixr.html index a62dc940..7e20faeb 100644 --- a/articles/estimation-nlmixr.html +++ b/articles/estimation-nlmixr.html @@ -159,7 +159,7 @@

Translation## y ~ prop(err_prop) + add(err_add) ## }) ## } -## <environment: 0x5595b2b160b0> +## <environment: 0x555d3b127600>

A full code example is included below.

Note: both nlmixr and the nlmixr-translator in PKPDsim are still under active development. Syntax and results may therefore @@ -231,21 +231,21 @@

Example## ## ── Time (sec fit$time): ── ## -## setup covariance saem table compress other -## elapsed 0.001876 0.016005 9.44 0.088 0.023 1.429119 +## setup covariance saem table compress other +## elapsed 0.002033 0.017005 9.944 0.089 0.023 1.418962 ## ## ── Population Parameters (fit$parFixed or fit$parFixedDf): ── ## ## Est. SE %RSE Back-transformed(95%CI) BSV(CV%) Shrink(SD)% -## logCL 1.58 0.0412 2.6 4.87 (4.49, 5.28) 22.5 19.8% -## logV 3.86 0.043 1.12 47.4 (43.5, 51.5) 15.3 42.8% -## err_prop 0.204 0.204 -## err_add 1.43 1.43 +## logCL 1.64 0.0493 3.01 5.15 (4.67, 5.67) 27.4 19.8% +## logV 3.86 0.0483 1.25 47.5 (43.2, 52.2) 13.4 28.9% +## err_prop 0.258 0.258 +## err_add 1.41 1.41 ## ## Covariance Type (fit$covMethod): linFim ## Correlations in between subject variability (BSV) matrix: ## cor:eta_V,eta_CL -## 0.463 +## 0.886 ## ## ## Full BSV covariance (fit$omega) or correlation (fit$omegaR; diagonals=SDs) @@ -254,11 +254,11 @@

Example## ## ── Fit Data (object fit is a modified tibble): ── ## # A tibble: 200 × 16 -## ID TIME DV PRED RES IPRED IRES IWRES eta_CL eta_V y A1 -## <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -## 1 1 8 13.4 13.9 -0.524 12.9 0.474 0.159 0.0904 -0.0426 12.9 586. -## 2 1 23.5 2.17 2.83 -0.652 2.09 0.0830 0.0558 0.0904 -0.0426 2.09 94.8 -## 3 1 25 36.7 31.0 5.66 31.1 5.52 0.848 0.0904 -0.0426 31.1 1413. +## ID TIME DV PRED RES IPRED IRES IWRES eta_CL eta_V y A1 +## <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +## 1 1 8 17.6 13.3 4.31 19.5 -1.89 -0.362 -0.449 -0.177 19.5 776. +## 2 1 23.5 7.00 2.48 4.52 5.42 1.57 0.792 -0.449 -0.177 5.42 216. +## 3 1 25 46.2 30.4 15.8 39.5 6.74 0.655 -0.449 -0.177 39.5 1572. ## # ℹ 197 more rows ## # ℹ 4 more variables: CL <dbl>, V <dbl>, tad <dbl>, dosenum <dbl> diff --git a/articles/example-pkpd-model_files/figure-html/example-pkpd-1.png b/articles/example-pkpd-model_files/figure-html/example-pkpd-1.png index d0585aa5..c01cb745 100644 Binary files a/articles/example-pkpd-model_files/figure-html/example-pkpd-1.png and b/articles/example-pkpd-model_files/figure-html/example-pkpd-1.png differ diff --git a/articles/variability_files/figure-html/plot-1.png b/articles/variability_files/figure-html/plot-1.png index dea40833..5772e3b8 100644 Binary files a/articles/variability_files/figure-html/plot-1.png and b/articles/variability_files/figure-html/plot-1.png differ diff --git a/articles/variability_files/figure-html/plot-2.png b/articles/variability_files/figure-html/plot-2.png index 6387fa4c..e29508f4 100644 Binary files a/articles/variability_files/figure-html/plot-2.png and b/articles/variability_files/figure-html/plot-2.png differ diff --git a/pkgdown.yml b/pkgdown.yml index 2654debd..38073c84 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -16,7 +16,7 @@ articles: simulation: simulation.html speed: speed.html variability: variability.html -last_built: 2024-01-05T20:30Z +last_built: 2024-01-08T20:56Z urls: reference: https://insightrx.github.io/PKPDsim/reference article: https://insightrx.github.io/PKPDsim/articles diff --git a/search.json b/search.json index b4ee1166..e6b75fc4 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://insightrx.github.io/PKPDsim/articles/PKPDsim.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"Getting started","text":"PKPDsim can installed CRAN: can install development version GitHub:","code":"install.packages(\"PKPDsim\") devtools::install_github(\"InsightRX/PKPDsim\")"},{"path":"https://insightrx.github.io/PKPDsim/articles/PKPDsim.html","id":"first-simulation","dir":"Articles","previous_headings":"","what":"First simulation","title":"Getting started","text":"main simulation function PKPDsim sim(). able simulate dosing regimen specific drug, least following three arguments required: ode: compiled ODE model (created using new_ode_model() function) parameters: list parameter values model regimen: dosing regimen (created using new_regimen() function) model library PKPDsim contains small library built-PK PD models, course interesting ability handle user-specified ODE systems. However, first example, let’s implement simple example library: probably noticed new_ode_model()-step took seconds finish, simulation order milliseconds. new_ode_model(), model compiled C++ source code binary code, takes seconds. However, done . compilation, model available used sim() long R session open. Let’s look output. PKPDsim output data “long” format, .e. one row per observed timepoint, split compartment: check output produced sim(), let’s plot (installation ggplot2 required).","code":"p <- list(CL = 1, V = 10, KA = 0.5) pk1 <- new_ode_model(\"pk_1cmt_oral\") r1 <- new_regimen( amt = 100, n = 5, interval = 12 ) dat <- sim( ode = pk1, parameters = p, regimen = r1 ) head(dat) ## id t comp y obs_type ## 1 1 0 1 100.00000 1 ## 4 1 1 1 60.65307 1 ## 40 1 2 1 36.78794 1 ## 76 1 3 1 22.31302 1 ## 112 1 4 1 13.53353 1 ## 148 1 5 1 8.20850 1 ggplot(dat, aes(x = t, y = y)) + geom_line() + facet_wrap(~ comp)"},{"path":"https://insightrx.github.io/PKPDsim/articles/PKPDsim.html","id":"custom-ode-model","dir":"Articles","previous_headings":"","what":"Custom ODE model","title":"Getting started","text":"can write exact model using custom ODE code. following example also output concentration (only_obs=TRUE), amounts compartment. ’re also going use infusion instead bolus injection:","code":"pk2 <- new_ode_model( code = \"dAdt[1] = -(CL/V) * A[1]\", obs = list(cmt = 1, scale = \"V\"), dose = list(cmt = 1) ) r2 <- new_regimen( amt = 100, n = 5, interval = 12, type = \"infusion\", t_inf = 2 ) dat2 <- sim( ode = pk2, parameters = p, regimen = r2, only_obs = TRUE ) ggplot(dat2, aes(x = t, y = y)) + geom_line()"},{"path":"https://insightrx.github.io/PKPDsim/articles/PKPDsim.html","id":"included-models","dir":"Articles","previous_headings":"","what":"Included models","title":"Getting started","text":"PKPDsim includes definitions several PK/PD models used InsightRX platform. models can installed R packages using model_from_api() function. Please note models may differ used production InsightRX. provided demonstration purposes , used dosing patients.","code":"model_from_api( system.file(\"models\", \"pk_vanco_anderson.json5\", package = \"PKPDsim\"), to_package = TRUE, install_all = TRUE )"},{"path":"https://insightrx.github.io/PKPDsim/articles/PKPDsim.html","id":"example-usage","dir":"Articles","previous_headings":"Included models","what":"Example usage","title":"Getting started","text":"simulate PK, provide model parameters PKPDsim::sim() along dosing regimen covariates.","code":"## Create dosing regimen and covariates reg <- new_regimen( amt = 100, n = 3, interval = 12, type = \"infusion\", t_inf = 1 ) covs <- list( WT = new_covariate(4), PMA = new_covariate(42), CR = new_covariate(0.5), CL_HEMO = new_covariate(0) ) ## Perform simulation sim( ode = pkvancoanderson::model(), parameters = pkvancoanderson::parameters(), regimen = reg, covariates = covs )"},{"path":"https://insightrx.github.io/PKPDsim/articles/covariates.html","id":"covariates","dir":"Articles","previous_headings":"","what":"Covariates","title":"Covariates","text":"Covariates implemented using new_covariate() function, wrapped named list. example: names covariate list-object correspond exactly names covariates model.","code":"covariates <- list( \"WT\" = new_covariate(value = 70), \"SCR\" = new_covariate(value = 120) )"},{"path":"https://insightrx.github.io/PKPDsim/articles/covariates.html","id":"time-varying-covariates","dir":"Articles","previous_headings":"Covariates","what":"Time-varying covariates","title":"Covariates","text":"Time-varing covariates, creatinine values can implemented easily well. just require additional times argument: default, PKPDsim assumes want interpolate (linearly) measurements time-varying covariates. prefer implement covariate using last-observation-carried-forward (words step function), specify method = \"LOCF\" argument new_covariate().","code":"covariates <- list( \"WT\" = new_covariate(value = 70), \"CR\" = new_covariate( value = c(0.8, 1, 1.2), times = c(0, 48, 72) ) )"},{"path":"https://insightrx.github.io/PKPDsim/articles/covariates.html","id":"covariates-for-multiple-patients","dir":"Articles","previous_headings":"Covariates","what":"Covariates for multiple patients","title":"Covariates","text":"table covariates can supplied sim() covariate values per individual. can handle static time-varying covariates. covariate table look like : id t (time) columns can omitted static covariates used. , make sure headers used covariates match exactly covariate names specified model definition. full example model (simulated) covariates patient population: Note: PKPDsim handle missing covariate values. missing covariate data, probably best approach impute values manually simulation, e.g. based mean observed / known value, correlation covariates.","code":"cov_table <- data.frame( id = c(1, 1, 2, 3), WT = c(40, 45, 50, 60), SCR = c(50, 150, 90, 110), t = c(0, 5, 0, 0) ) parameters <- list( CL = 1, V = 10, KA = 0.5 ) n_ind <- 50 cov_table <- data.frame( 'id' = 1:n_ind, 'WT' = rnorm(n_ind, mean = 70, sd = 5) ) model <- new_ode_model( code = ' CLi = CL * pow((WT/70), 0.75) Vi = V * (WT/70) dAdt[1] = -KA*A[1] dAdt[2] = KA*A[1] -(CLi/Vi)*A[2] ', declare_variables = c('CLi', 'Vi'), covariates = c('WT'), dose = list(cmt = 1), obs = list(cmt = 2, scale = 'V * (WT/70)') ) regimen <- new_regimen( amt = 30, n = 4, type = 'bolus', interval = 12 ) dat <- sim( ode = model, parameters = parameters, t_obs = c(0.5, 2, 4, 8, 12, 16, 24), n_ind = n_ind, regimen = regimen, covariates_table = cov_table, output_include = list(covariates = TRUE) ) ## Simulating 50 individuals."},{"path":"https://insightrx.github.io/PKPDsim/articles/error.html","id":"residual-error","dir":"Articles","previous_headings":"","what":"Residual error","title":"Residual error","text":"PKPDsim can simulate residual errors observed data, can done res_var argument sim() function. argument requires list() one following components: prop: proportional error: \\[y = \\hat{y} \\cdot (1 + \\mathcal{N}(0, prop))\\] add: additive error: \\[y = \\hat{y} + \\mathcal{N}(0, add))\\] exp: exponential error: \\[y = \\hat{y} \\cdot e^{\\mathcal{N}(0, exp)}\\] list elements can combined, e.g. combined proportional additive error model one write e.g.: res_var = list(prop = 0.1, add = 1), give 10% proportional error plus additive error 1 concentration unit. examples res_var argument Combined proportional additive: Exponential: Besides including residual error simulation time, also option include afterwards. , function add_ruv() useful.","code":"mod <- new_ode_model(\"pk_1cmt_iv\") reg <- new_regimen( amt = 1000, n = 5, interval = 12, type = \"bolus\" ) sim1 <- sim( mod, parameters = list(CL = 5, V = 150), res_var = list(prop = 0.1, add = 1), regimen = reg, only_obs=TRUE ) ggplot(sim1, aes(x = t, y = y)) + geom_point() sim2 <- sim( mod, parameters = list(CL = 5, V = 150), res_var = list(exp = 0.1), regimen = reg, only_obs=TRUE ) sim3 <- sim1 sim3$y <- add_ruv( x = sim3$y, ruv = list( prop = 0.1, add = 1 ) ) ggplot(sim3, aes(x = t, y = y)) + geom_point()"},{"path":"https://insightrx.github.io/PKPDsim/articles/estimation-nlmixr.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Estimation: nlmixr2","text":"PKPDsim R package include functionality perform population estimation within package, offer convenient translator able use nlmixr2 R package parameter estimation. nlmixr2 allows fitting population PK-PD models using common algorithms applied pharmacometrics, FOCE SAEM. installation usage nlmixr2, please refer documentation nlmixr2 package respective website.","code":""},{"path":"https://insightrx.github.io/PKPDsim/articles/estimation-nlmixr.html","id":"translation","dir":"Articles","previous_headings":"","what":"Translation","title":"Estimation: nlmixr2","text":"hood, nlmixr2 uses rxode2 R package perform PKPD model simulations, similar PKPDsim. model syntax rxode2 nlmixr2 compared PKPDsim also similar, making translation fairly straightforward. model translator function therefore included PKPDsim allows translation PKPDsim model nlmixr2 syntax: returned object f generated pkpdsim_to_nlmixr() object defines required model parameter definitions nlmixr syntax: full code example included . Note: nlmixr nlmixr-translator PKPDsim still active development. Syntax results may therefore change.","code":"mod <- new_ode_model(\"pk_1cmt_iv\") f <- pkpdsim_to_nlmixr( model = mod, parameters = list(CL = 5, V = 50), omega = c(0.1, 0.05, 0.1), res_var = list(prop = 0.1, add = 0.1), log_transform = TRUE ) f ## function () ## { ## ini({ ## logCL <- log(5) ## logV <- log(50) ## err_prop <- c(0, 0.1, 1) ## err_add <- c(0, 1, 10) ## eta_CL + eta_V ~ c(0.1, 0.05, 0.1) ## }) ## model({ ## CL <- exp(logCL + eta_CL) ## V <- exp(logV + eta_V) ## d/dt(A1) = -(CL/V) * A1 ## y = A1/V ## y ~ prop(err_prop) + add(err_add) ## }) ## } ## "},{"path":"https://insightrx.github.io/PKPDsim/articles/estimation-nlmixr.html","id":"example","dir":"Articles","previous_headings":"","what":"Example","title":"Estimation: nlmixr2","text":"","code":"library(tidyverse) library(nlmixr2) ## Define parameters par <- list(CL = 5, V = 50) ruv <- list(prop = 0.1, add = 1) omega <- c(0.1, 0.05, 0.1) ## Simulate data t_obs <- c(8, 23.5, 25, 71.5) n <- 50 regimen <- new_regimen( amt = 1500, n = 4, interval = 24 ) conc <- sim( ode = mod, regimen = regimen, parameters = par, omega = omega, only_obs = T, t_obs = t_obs, n = n, res_var = ruv ) %>% mutate(EVID = 0, AMT = 0, MDV = 0, CMT = 1) %>% select(ID = id, TIME = t, CMT, DV = y, AMT, EVID, MDV) doses <- regimen_to_nm( regimen, n_ind = n ) ## Combine observed data and dose data simdat <- bind_rows(doses, conc) %>% dplyr::arrange(ID, TIME) ## Create nlmixr model object f <- pkpdsim_to_nlmixr( model = mod, parameters = par, omega = c(0.1, 0.05, 0.1), res_var = list(prop = 0.1, add = 0.1), log_transform = T ) ## Perform fit using nlmixr (SAEM) fit <- nlmixr( object = f, data = simdat, est = \"saem\" ) fit ## ── nlmixr² SAEM OBJF by FOCEi approximation ── ## ## Gaussian/Laplacian Likelihoods: AIC(fit) or fit$objf etc. ## FOCEi CWRES & Likelihoods: addCwres(fit) ## ## ── Time (sec fit$time): ── ## ## setup covariance saem table compress other ## elapsed 0.001876 0.016005 9.44 0.088 0.023 1.429119 ## ## ── Population Parameters (fit$parFixed or fit$parFixedDf): ── ## ## Est. SE %RSE Back-transformed(95%CI) BSV(CV%) Shrink(SD)% ## logCL 1.58 0.0412 2.6 4.87 (4.49, 5.28) 22.5 19.8% ## logV 3.86 0.043 1.12 47.4 (43.5, 51.5) 15.3 42.8% ## err_prop 0.204 0.204 ## err_add 1.43 1.43 ## ## Covariance Type (fit$covMethod): linFim ## Correlations in between subject variability (BSV) matrix: ## cor:eta_V,eta_CL ## 0.463 ## ## ## Full BSV covariance (fit$omega) or correlation (fit$omegaR; diagonals=SDs) ## Distribution stats (mean/skewness/kurtosis/p-value) available in fit$shrink ## Censoring (fit$censInformation): No censoring ## ## ── Fit Data (object fit is a modified tibble): ── ## # A tibble: 200 × 16 ## ID TIME DV PRED RES IPRED IRES IWRES eta_CL eta_V y A1 ## ## 1 1 8 13.4 13.9 -0.524 12.9 0.474 0.159 0.0904 -0.0426 12.9 586. ## 2 1 23.5 2.17 2.83 -0.652 2.09 0.0830 0.0558 0.0904 -0.0426 2.09 94.8 ## 3 1 25 36.7 31.0 5.66 31.1 5.52 0.848 0.0904 -0.0426 31.1 1413. ## # ℹ 197 more rows ## # ℹ 4 more variables: CL , V , tad , dosenum "},{"path":"https://insightrx.github.io/PKPDsim/articles/example-absorption-models.html","id":"absorption-with-lag-time","dir":"Articles","previous_headings":"","what":"Absorption with lag time","title":"Absorption models","text":"Specify lagtime create model using new_ode_model. lag time can either number, string referring parameter (e.g. “ALAG”). single number parameter specified, lag time apply default dose compartment . Alternatively, also possible specify vector lag times, value compartment.","code":"library(\"PKPDsim\") pk <- new_ode_model( code = \" dAdt[1] = -KA * A[1]; dAdt[2] = KA*A[1] -(CL/V) * A[2] \", obs = list(cmt = 2, scale=\"V\"), dose = list(cmt = 1), lagtime = \"ALAG\" ) r <- new_regimen( amt = c(100, 100, 100), times = c(0, 12, 24), cmt = 1 ) p <- list(CL = 5, V = 10, KA = 0.25, ALAG = 2) res <- sim( ode = pk, n_ind = 25, omega = cv_to_omega( par_cv = list(\"CL\" = 0.1, \"V\" = 0.1, \"KA\" = .1, \"ALAG\" = 0.3), p ), parameters = p, regimen = r, verbose = FALSE, only_obs = TRUE )"},{"path":"https://insightrx.github.io/PKPDsim/articles/example-absorption-models.html","id":"absorption-transit-compartments","dir":"Articles","previous_headings":"","what":"Absorption transit compartments","title":"Absorption models","text":"code implements transit compartment model absorption compartments described Savic et al. JPKPD 2007. Please note implementation assumes drug amount absorbed within dosing interval. assumption might always hold. Also, implementation dosing, essential set bioavailability dose compartment 0, since dosing now implemented using separate analytical equation. Note: simplified way coding transit compartments model added soon PKPDsim.","code":"library(PKPDsim) parameters <- list(CL = 15, V = 50, MTT = 2.5, N = 4, KA = 1) reg1 <- new_regimen(amt = 100, n = 3, interval = 12) # needs dummy doses mod <- new_ode_model( code = \" tad = t - t_prv_dose KTR = (N+1)/MTT LNFAC= log(2.506628)+(N+0.5)*log(N)-N dAdt[1] = exp(log(prv_dose) + log(KTR) + N*log(KTR * tad) - KTR * tad - LNFAC) - KA*A[1] dAdt[2] = KA*A[1]-CL/V*A[2] \", declare_variables = c(\"LNFAC\", \"KTR\", \"tad\"), parameters = parameters, dose = list(cmt = 1, bioav = 0), obs = list(cmt = 2, scale = \"V\") ) res <- sim( ode = mod, regimen = reg1, parameters = parameters, n = 5, omega = cv_to_omega( list(CL = 0.1, V = 0.1, MTT = 0.2, N =0.1, KA=0.1), parameters ), t_obs = seq(0, 36, .5) )"},{"path":"https://insightrx.github.io/PKPDsim/articles/example-pkpd-model.html","id":"combine-pk-and-pd-models","dir":"Articles","previous_headings":"","what":"Combine PK and PD models","title":"PKPD model","text":"shown , PK-PD model can written single set differential equations. However, often develop PK PD models separately e.g. want plug various PK models existing PD models. PKPDsim can two model parts separately list code argument: two systems ODEs combined single one.","code":"pkpd <- new_ode_model( code = list( pk = \"dAdt[1] = -(CL/V) * A[1]; conc = A[1]/V; \", pd = \" dAdt[1] = KIN * 1/(1+EFF*conc) - KOUT*A[1]; \" ), state_init = list(pd = \"A[1] = KIN/KOUT;\") )"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Model","text":"new_ode_model function creates new ODE model can used sim() command. defines ODE system sets attributes model. model can specified three different ways: model: string references model library included PKPDsim. Examples current library e.g. pk_1cmt_oral, pk_2cmt_iv. show available models, run new_ode_model() without arguments. code: using code specifying derivatives ODE specified pseudo-R code file: similar code, reads code file","code":""},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"model-from-library","dir":"Articles","previous_headings":"","what":"Model from library","title":"Model","text":"example, 1-compartment oral PK model can obtained using: Run new_ode_model() function without arguments see currently available models:","code":"pk1 <- new_ode_model(model = \"pk_1cmt_oral\") new_ode_model() ## Error in new_ode_model(): Either a model name (from the PKPDsim library), ODE code, an R function, or a file containing code for the ODE system have to be supplied to this function. The following models are available: ## pk_1cmt_iv ## pk_1cmt_iv_auc ## pk_1cmt_iv_mm ## pk_2cmt_iv ## pk_2cmt_iv_auc ## pk_3cmt_iv ## pk_1cmt_oral ## pk_2cmt_oral ## pk_3cmt_oral"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"custom-model-from-code","dir":"Articles","previous_headings":"","what":"Custom model from code","title":"Model","text":"custom model needs specified string text block: input code adhere follow rules: derivaties ODE system defined using dAdt array indices derivatives compartments indicated [ ]. Compartments indices can start either 0 1. latter, indices reduced 1 translation C++ code. equations defined using = power functions need written pow(base,exp). force numbers interpreted real, avoid interpreted integer. equation involves real number 3, usually safer write 3.0 code. input code translated C++ function. can check model compiled correctly typing model name R command line, prints model information: ’re interested, can also output actual C++ function compiled specifying cpp_show_code=TRUE argument new_ode_model() function.","code":"pk1 <- new_ode_model(code = \" dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL/V) * A[2] \") pk1 ## ODE definition: ## ## dAdt[1] = -KA * A[1]; ## dAdt[2] = +KA * A[1] -(CL/V) * A[2]; ## ; ## ## Required parameters: KA, CL, V ## Covariates: ## Variables: ## Fixed parameters: ## Number of compartments: 2 ## Observation variable: ## Observation scaling: 1 ## Lag time: none ## IOV CV: {} ## IOV bins: 1 ## Comments: ## -"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"more-custom-model-options","dir":"Articles","previous_headings":"","what":"More custom model options","title":"Model","text":"can introduce new variables code, define using declare_variables argument : Also, want use covariates ODE system (info define covariates Covariates vignette), define , code function call: One exception input code syntax definition power functions. PKPDsim translate pseudo-R code valid C++ syntax automatically. C/C++ use ^ indicate power functions, uses pow(value, base) function instead, example allometric PK model written :","code":"pk1 <- new_ode_model(code = \" KEL = CL/V dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -KEL * A[2] \", declare_variables = c(\"KEL\")) pk1 <- new_ode_model(code = \" CLi = WT/70 KEL = CLi/V dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL*(WT/70)/V) * A[2] \", declare_variables = c(\"KEL\", \"CLi\"), covariates = c(\"WT\")) pk1 <- new_ode_model(code = \" CLi = CL * pow((WT/70), 0.75) dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CLi/V) * A[2] \", declare_variables = c(\"CLi\"))"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"dosing-bioavailability","dir":"Articles","previous_headings":"More custom model options","what":"Dosing / bioavailability","title":"Model","text":"default dosing compartment bioavailability can specified using dose argument. default, dose go compartment 1, bioavailability 1. bioav element list can either number character string referring parameter. Bioavailability can also used dosing based mg/kg, since supported new_regimen(). way implement scaling dose “weight” covariate using bioavailability:","code":"pk1 <- new_ode_model(code = \" dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL/V) * A[2] \", dose = list(cmt = 1, bioav = \"F1\"), parameters = list(KA = 1, CL = 5, V = 50, F1 = 0.7) ) mod <- new_ode_model(code = \" dAdt[1] = -(CL/V)*A[1]; \", dose = list(cmt = 1, bioav = \"WT\"), obs = list(cmt = 1, scale = \"V\"), covariates = list(\"WT\" = new_covariate(value = 70)) )"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"observations","dir":"Articles","previous_headings":"More custom model options","what":"Observations","title":"Model","text":"observation compartment can set specifying list obs argument, either elements cmt scale, variable. scale can either parameter number, cmt can number. Note variables specified inside differential equation block available scaling parameters. E.g. allometry redefine scaled volume follows: define observation using variable:","code":"pk1 <- new_ode_model(code = \" dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL/V) * A[2] \", obs = list(cmt = 2, scale = \"V\") ) pk1 <- new_ode_model(code = \" Vi = V * (WT/70) dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL/Vi) * A[2] \", obs = list(cmt = 2, scale = \"V * (WT/70)\") ) pk1 <- new_ode_model(code = \" dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL/V) * A[2] CONC = A[2] \", obs = list(variable = \"CONC\"), declare_variables = \"CONC\" )"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"custom-model-from-file","dir":"Articles","previous_headings":"","what":"Custom model from file","title":"Model","text":"Using file= argument, model code read specified files. just convenience function, .e. allows separate models R code easily.","code":"pk1 <- new_ode_model( file = \"pk_1cmt_oral_nonlin_v1.txt\", declare_variables = c(\"KEL\", \"CLi\") )"},{"path":"https://insightrx.github.io/PKPDsim/articles/output.html","id":"multiple-observation-types","dir":"Articles","previous_headings":"","what":"Multiple observation types","title":"Output","text":"like output one observation type, concentration parent drug concentration metabolite, can control using obs argument. example amount absorption compartment well systemic drug concentration outputted.","code":"mod <- new_ode_model(code = \" dAdt[1] = -KA * A[1]; dAdt[2] = -(CL/V) * A[2] + KA*A[1]; \", obs = list( cmt = c(2, 2), scale = c(1, \"V\"), label = c(\"abs\", \"conc\") ) ) par <- list(CL = 5, V = 50, KA = .5) reg <- new_regimen(amt = 100, n = 5, interval = 12) res <- sim( ode = mod, parameters = par, regimen = reg, only_obs = T )"},{"path":"https://insightrx.github.io/PKPDsim/articles/output.html","id":"parameters-variables-and-covariates","dir":"Articles","previous_headings":"","what":"Parameters, variables, and covariates","title":"Output","text":"often useful include model parameters, generated variables, /covariates output table well, especially covariates -subject variability included simulation, debugging models. can use output_include argument :","code":"mod_1cmt_iv <- new_ode_model(\"pk_1cmt_iv\") p <- list(CL = 5, V = 50) reg <- new_regimen (amt = 100, n = 4, interval = 12, type = \"bolus\", cmt=1) cov_table <- data.frame( id = c(1, 1, 2, 3), WT = c(40, 45, 50, 60), SCR = c(50, 150, 90,110), t = c(0, 5, 0, 0) ) dat <- sim( ode = mod_1cmt_iv, parameters = p, regimen = reg, covariates_table = cov_table, covariates_implementation = list(SCR = \"interpolate\"), n_ind = 3, only_obs = T, output_include = list(parameters = TRUE, covariates=TRUE) ) ## Simulating 3 individuals. head(dat) ## id t comp y obs_type CL V WT SCR ## 1 1 0 obs 2.000000 1 5 50 40 50 ## 4 1 1 obs 1.809675 1 5 50 41 70 ## 40 1 2 obs 1.637462 1 5 50 42 90 ## 76 1 3 obs 1.481636 1 5 50 43 110 ## 112 1 4 obs 1.340640 1 5 50 44 130 ## 142 1 5 obs 1.213061 1 5 50 45 150"},{"path":"https://insightrx.github.io/PKPDsim/articles/regimen.html","id":"steady-state","dir":"Articles","previous_headings":"","what":"Steady state","title":"Regimen","text":"Instead simulating full concentration time course give model, want simulate PK(PD) steady state, can also specify ss=TRUE argument new_regimen(), simulate regimen steady state. default, steady state assumed occur 5 days (PKPDsim doesn’t check steady state reached!), want decrease increase can specifying n_ss argument takes number doses simulate assuming steady state.","code":"reg_ss <- new_regimen( amt = 100, interval = 12, n = 5, ss = TRUE, n_ss = 10 ) reg_ss ## Note: Steady state regimen, steady state assumed to be reached at t = 0. ## t type amt t_inf ## 1 0 bolus 100 0 ## 2 12 bolus 100 0 ## 3 24 bolus 100 0 ## 4 36 bolus 100 0 ## 5 48 bolus 100 0"},{"path":"https://insightrx.github.io/PKPDsim/articles/speed.html","id":"comparison-with-other-packages","dir":"Articles","previous_headings":"","what":"Comparison with other packages","title":"Speed","text":"Several open source R packages provide similar features PKPDsim, main ones RxODE (now renamed rxode2) mrgsolve. rxode2 package, overhead pre- post-processing separated main simulation function default, mrgsolve similar PKPDsim overhead included within main simulation function. Therefore, especially used iterative context, RxODE seem much faster PKDPsim mrgsolve, PKPDsim mrgsolve seem broadly similar. However, using sim_core() function outlined , benchmarks indicate simulation speed PKDDsim highly similar obtained RxODE package.","code":""},{"path":"https://insightrx.github.io/PKPDsim/articles/variability.html","id":"variability-distribution","dir":"Articles","previous_headings":"","what":"Variability distribution","title":"Variability","text":"default, PKPDsim assume exponential distribution parameters omega specified. normal distribution desired parameters, please use omega_type argument:","code":"dat <- sim( ode = model, parameters = parameters, regimen = regimen, n = 50, omega = c( 0.2, 0.05, 0.1 ), omega_type = c(\"normal\", \"normal\") )"},{"path":"https://insightrx.github.io/PKPDsim/articles/variability.html","id":"more-flexible-variability-models","dir":"Articles","previous_headings":"","what":"More flexible variability models","title":"Variability","text":"allow flexibility -subject variability enters model, alternative way specifying variability. approach similar way variability encoded NONMEM, .e. variability components (eta’s) added explicitly model code. PKPDsim means eta’s treated just like regular parameters, 0 mean normal distribution. See example simulation bioavailability using logit-distribution.","code":"mod1 <- new_ode_model( code = \" CLi = CL * exp(eta1) Vi = V * exp(eta2) F1i = exp(F1 + eta3) / (1 + exp(F1 + eta3)) dAdt[1] = -KA * A[1] dAdt[2] = KA * A[1] - (CLi/Vi) * A[2] \", declare_variables = c(\"CLi\", \"Vi\", \"F1i\"), obs = list(cmt = 2, scale = \"V * exp(eta2)\"), dose = list(cmt = 1, bioav = \"F1i\") ) reg1 <- new_regimen(amt = 100, n = 2, interval = 12, type=\"oral\") dat <- sim( ode = mod1, regimen = reg1, parameters = list( eta1 = 0, eta2 = 0, eta3 = 0, CL = 5, V = 50, KA = .5, F1 = 0.8 ), t_obs = c(0:48), omega = c( 0.1, 0.05, 0.1, 0, 0, 0.1 ), n = 100, omega_type = c(\"normal\", \"normal\", \"normal\"), output_include = list(\"parameters\" = TRUE, variables = TRUE), only_obs = TRUE ) library(ggplot2) ggplot(dat, aes(x = t, y = y, group = id)) + geom_line() ggplot(dat, aes(x = F1i)) + geom_histogram() ## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`."},{"path":"https://insightrx.github.io/PKPDsim/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Ron Keizer. Author, maintainer. Jasmine Hughes. Author. Dominic Tong. Author. Kara Woo. Author. InsightRX. Copyright holder, funder.","code":""},{"path":"https://insightrx.github.io/PKPDsim/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Keizer R, Hughes J, Tong D, Woo K (2024). PKPDsim: Tools Performing Pharmacokinetic-Pharmacodynamic Simulations. R package version 1.3.0, https://insightrx.github.io/PKPDsim/, https://github.com/InsightRX/PKPDsim.","code":"@Manual{, title = {PKPDsim: Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations}, author = {Ron Keizer and Jasmine Hughes and Dominic Tong and Kara Woo}, year = {2024}, note = {R package version 1.3.0, https://insightrx.github.io/PKPDsim/}, url = {https://github.com/InsightRX/PKPDsim}, }"},{"path":"https://insightrx.github.io/PKPDsim/index.html","id":"pkpdsim-","dir":"","previous_headings":"","what":"Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations","title":"Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations","text":"PKPDsim library numerical integration ODE systems, particular pharmacokinetic-pharmacodynamic (PK-PD) mixed-effects models.","code":""},{"path":"https://insightrx.github.io/PKPDsim/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations","text":"development version PKPDsim always --date improvements bug fixes. aim release PKPDsim CRAN least year, depending number impact updates made development version. CRAN version PKPDsim can installed using: development version PKPDsim can installed using:","code":"install.packages(\"PKPDsim\") devtools::install_github(\"InsightRX/PKPDsim\")"},{"path":"https://insightrx.github.io/PKPDsim/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations","text":"welcome input community: think encountered bug, please submit issue GitHub page. Please include reproducible example unexpected behavior. Please open pull request fix updates improve package. ’re sure proposed changes useful within scope package, feel free contact one authors package.","code":""},{"path":"https://insightrx.github.io/PKPDsim/index.html","id":"disclaimer","dir":"","previous_headings":"","what":"Disclaimer","title":"Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations","text":"functionality R package provided “”. authors adhere software development best practices, software may still contain unintended errors. InsightRX Inc. authors package can held liable damages resulting use software. use software package, user waives warranties, expressed implied, including warranties accuracy, quality suitability InsightRX particular purpose, either medical non-medical. ©","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":null,"dir":"Reference","previous_headings":"","what":"ADVAN-style equations — OneCompIVbolus","title":"ADVAN-style equations — OneCompIVbolus","text":"Adapted Abuhelwa et al. JPET 2015","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ADVAN-style equations — OneCompIVbolus","text":"","code":"OneCompIVbolus(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ADVAN-style equations — OneCompIVbolus","text":"d data, NONMEM style data frame 1 subject columns TIME, AMT, MDV, DV, CL, V","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ADVAN-style equations — OneCompIVbolus","text":"Returns dataframe populated columns A1, DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ADVAN-style equations — OneCompIVbolus","text":"Functions calculating drug amount compartments common pharmacokinetic models (1,2,3 compartment IV bolus, IV infusion, first-order absorption models) Definitions: - *last: initial amount beginning time interval (t, t=t2-t1) corresponding compartment (.e. drug amount end last time interval) - E* : sum Exit (elimination) rate constant corresponding compartment. IV bolus- 1 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"ADVAN-style equations — OneCompIVbolus","text":"Abuhelwa, . Y., Foster, D. J. R., Upton, R. N. (2015) ADVAN-style analytical solutions common pharmacokinetic models. J Pharmacol Toxicol Methods 73:42-8. DOI: 10.1016/j.vascn.2015.03.004","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVinfusion.html","id":null,"dir":"Reference","previous_headings":"","what":"IV infusion- 1 compartment — OneCompIVinfusion","title":"IV infusion- 1 compartment — OneCompIVinfusion","text":"IV infusion- 1 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVinfusion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"IV infusion- 1 compartment — OneCompIVinfusion","text":"","code":"OneCompIVinfusion(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVinfusion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"IV infusion- 1 compartment — OneCompIVinfusion","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV, RATE, RATEALL, DV, CL, V","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVinfusion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"IV infusion- 1 compartment — OneCompIVinfusion","text":"Returns dataframe populated columns A1, DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompOral.html","id":null,"dir":"Reference","previous_headings":"","what":"first-order absorption 1 compartment — OneCompOral","title":"first-order absorption 1 compartment — OneCompOral","text":"first-order absorption 1 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompOral.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"first-order absorption 1 compartment — OneCompOral","text":"","code":"OneCompOral(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompOral.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"first-order absorption 1 compartment — OneCompOral","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,DV, CL, V, KA & F1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompOral.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"first-order absorption 1 compartment — OneCompOral","text":"Returns dataframe populated columns A1, A2 DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/PKPDsim-package.html","id":null,"dir":"Reference","previous_headings":"","what":"PKPDsim package — PKPDsim-package","title":"PKPDsim package — PKPDsim-package","text":"Simulate regimens PKPD models defined ODE systems","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/PKPDsim-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"PKPDsim package — PKPDsim-package","text":"Ron Keizer ronkeizer@gmail.com","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVbolus.html","id":null,"dir":"Reference","previous_headings":"","what":"IV bolus- 3 compartment — ThreeCompIVbolus","title":"IV bolus- 3 compartment — ThreeCompIVbolus","text":"IV bolus- 3 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVbolus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"IV bolus- 3 compartment — ThreeCompIVbolus","text":"","code":"ThreeCompIVbolus(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVbolus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"IV bolus- 3 compartment — ThreeCompIVbolus","text":"d data, Accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,DV, CL, V1, Q12, V2, Q13, V3","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVbolus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"IV bolus- 3 compartment — ThreeCompIVbolus","text":"Returns dataframe populated columns A1, A2, A3,DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusion.html","id":null,"dir":"Reference","previous_headings":"","what":"IV infusion- 3 compartment — ThreeCompIVinfusion","title":"IV infusion- 3 compartment — ThreeCompIVinfusion","text":"IV infusion- 3 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"IV infusion- 3 compartment — ThreeCompIVinfusion","text":"","code":"ThreeCompIVinfusion(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"IV infusion- 3 compartment — ThreeCompIVinfusion","text":"d data, Accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,RATE, RATEALL, DV, CL, V1, Q12, V2, Q13, V3","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"IV infusion- 3 compartment — ThreeCompIVinfusion","text":"Returns dataframe populated columns A1, A2, A3,DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusionMetab.html","id":null,"dir":"Reference","previous_headings":"","what":"3-compartment IV infusion with first-order metabolite formation — ThreeCompIVinfusionMetab","title":"3-compartment IV infusion with first-order metabolite formation — ThreeCompIVinfusionMetab","text":"3-compartment IV infusion first-order metabolite formation","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusionMetab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"3-compartment IV infusion with first-order metabolite formation — ThreeCompIVinfusionMetab","text":"","code":"ThreeCompIVinfusionMetab(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusionMetab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"3-compartment IV infusion with first-order metabolite formation — ThreeCompIVinfusionMetab","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,RATE, RATEALL, DV, CL, V1, Q12, V2, Q13, V3, CLM,VM,km","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusionMetab.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"3-compartment IV infusion with first-order metabolite formation — ThreeCompIVinfusionMetab","text":"Returns dataframe populated columns A1, A2, A3,DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOral.html","id":null,"dir":"Reference","previous_headings":"","what":"first-order absorption- 3 compartment — ThreeCompOral","title":"first-order absorption- 3 compartment — ThreeCompOral","text":"first-order absorption- 3 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOral.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"first-order absorption- 3 compartment — ThreeCompOral","text":"","code":"ThreeCompOral(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOral.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"first-order absorption- 3 compartment — ThreeCompOral","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,DV, CL, V2, Q3, V3, Q4, V4, KA & F1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOral.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"first-order absorption- 3 compartment — ThreeCompOral","text":"Returns dataframe populated columns A1, A2, A3, A4 DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOralMetab.html","id":null,"dir":"Reference","previous_headings":"","what":"first-order absorption- 3 compartment-Metabolite — ThreeCompOralMetab","title":"first-order absorption- 3 compartment-Metabolite — ThreeCompOralMetab","text":"first-order absorption- 3 compartment-Metabolite","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOralMetab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"first-order absorption- 3 compartment-Metabolite — ThreeCompOralMetab","text":"","code":"ThreeCompOralMetab(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOralMetab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"first-order absorption- 3 compartment-Metabolite — ThreeCompOralMetab","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,DV, CL, V2, Q3, V3, Q4, V4, KA & F1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOralMetab.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"first-order absorption- 3 compartment-Metabolite — ThreeCompOralMetab","text":"Returns dataframe populated columns A1, A2, A3, A4 DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVbolus.html","id":null,"dir":"Reference","previous_headings":"","what":"IV bolus- 2 compartment — TwoCompIVbolus","title":"IV bolus- 2 compartment — TwoCompIVbolus","text":"IV bolus- 2 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVbolus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"IV bolus- 2 compartment — TwoCompIVbolus","text":"","code":"TwoCompIVbolus(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVbolus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"IV bolus- 2 compartment — TwoCompIVbolus","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV, DV, CL, V1, Q, V2","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVbolus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"IV bolus- 2 compartment — TwoCompIVbolus","text":"Returns dataframe populated columns A1, A2, DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVinfusion.html","id":null,"dir":"Reference","previous_headings":"","what":"IV infusion- 2 compartment — TwoCompIVinfusion","title":"IV infusion- 2 compartment — TwoCompIVinfusion","text":"IV infusion- 2 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVinfusion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"IV infusion- 2 compartment — TwoCompIVinfusion","text":"","code":"TwoCompIVinfusion(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVinfusion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"IV infusion- 2 compartment — TwoCompIVinfusion","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV, RATE, RATEALL, DV, CL, V1, Q, V2","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVinfusion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"IV infusion- 2 compartment — TwoCompIVinfusion","text":"Returns dataframe populated columns A1, A2, DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompOral.html","id":null,"dir":"Reference","previous_headings":"","what":"First-order absorption- 2 compartment — TwoCompOral","title":"First-order absorption- 2 compartment — TwoCompOral","text":"First-order absorption- 2 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompOral.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"First-order absorption- 2 compartment — TwoCompOral","text":"","code":"TwoCompOral(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompOral.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"First-order absorption- 2 compartment — TwoCompOral","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,DV, CL, V2, Q, V3, KA & F1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompOral.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"First-order absorption- 2 compartment — TwoCompOral","text":"Returns dataframe populated columns A1, A2, A3 DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_quotes.html","id":null,"dir":"Reference","previous_headings":"","what":"Put vector values in quotes — add_quotes","title":"Put vector values in quotes — add_quotes","text":"Put vector values quotes","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_quotes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Put vector values in quotes — add_quotes","text":"","code":"add_quotes(x, quote = \"double\")"},{"path":"https://insightrx.github.io/PKPDsim/reference/add_quotes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Put vector values in quotes — add_quotes","text":"x vector string / numeric quote type quotes (`double` `single`)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_quotes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Put vector values in quotes — add_quotes","text":"Character vector input quotation marks around value","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv.html","id":null,"dir":"Reference","previous_headings":"","what":"Add residual variability to the dependent variable — add_ruv","title":"Add residual variability to the dependent variable — add_ruv","text":"Add residual variability dependent variable","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add residual variability to the dependent variable — add_ruv","text":"","code":"add_ruv(x, ruv = list(), obs_type = 1)"},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add residual variability to the dependent variable — add_ruv","text":"x dependent value without residual variability ruv list specifying proportional, additive /exponential errors (`prop`, `add`, `exp`) obs_type vector observation types","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add residual variability to the dependent variable — add_ruv","text":"Input vector residual variability added","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv_to_quantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the increase in a specific quantile for a distribution on y when residual variability is added — add_ruv_to_quantile","title":"Calculate the increase in a specific quantile for a distribution on y when residual variability is added — add_ruv_to_quantile","text":"Calculate increase specific quantile distribution y residual variability added","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv_to_quantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the increase in a specific quantile for a distribution on y when residual variability is added — add_ruv_to_quantile","text":"","code":"add_ruv_to_quantile(y, sd_y, log_scale = FALSE, q = NULL, ruv = list(), ...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv_to_quantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the increase in a specific quantile for a distribution on y when residual variability is added — add_ruv_to_quantile","text":"y y sd_y standard deviation y without residual variability added. add normally distributed variability (potentially log-scale). log_scale add variability log scale (FALSE default, DEPRECATED!). q quantile ruv list residual variability (`prop` `add`) ... passed arguments","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv_to_quantile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the increase in a specific quantile for a distribution on y when residual variability is added — add_ruv_to_quantile","text":"Numeric vector y values residual variability","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_binomial.html","id":null,"dir":"Reference","previous_headings":"","what":"Binomial adherence — adherence_binomial","title":"Binomial adherence — adherence_binomial","text":"Model adherence binomial probability time occasion.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_binomial.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Binomial adherence — adherence_binomial","text":"","code":"adherence_binomial(n = 100, prob)"},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_binomial.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Binomial adherence — adherence_binomial","text":"n number occasions prob binomial probability","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_binomial.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Binomial adherence — adherence_binomial","text":"Returns vector length `n` containing values 0 (non-adherent) 1 (adherent). Numeric vector length n","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_markov.html","id":null,"dir":"Reference","previous_headings":"","what":"Markov adherence model — adherence_markov","title":"Markov adherence model — adherence_markov","text":"Model adherence markov chain model, based probability staying adherent becoming adherent non-adherent. Assumes patients start adherent.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_markov.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Markov adherence model — adherence_markov","text":"","code":"adherence_markov(n = 100, p11 = 0.9, p01 = 0.7)"},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_markov.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Markov adherence model — adherence_markov","text":"n number occasions p11 probability staying adherent p01 probability going non-adherent adherent state","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_markov.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Markov adherence model — adherence_markov","text":"Returns vector length `n` containing values 0 (non-adherent) 1 (adherent). Numeric vector length n","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan.html","id":null,"dir":"Reference","previous_headings":"","what":"ADVAN-style functions to calculate linear PK systems — advan","title":"ADVAN-style functions to calculate linear PK systems — advan","text":"ADVAN-style functions calculate linear PK systems","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ADVAN-style functions to calculate linear PK systems — advan","text":"","code":"advan(model, cpp = TRUE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/advan.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ADVAN-style functions to calculate linear PK systems — advan","text":"model Standard linear PK model, e.g. `pk_1cmt_iv_bolus`. cpp use C++-versions model (~50x faster R implementations)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ADVAN-style functions to calculate linear PK systems — advan","text":"Model function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_create_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Create ADVAN-style dataset — advan_create_data","title":"Create ADVAN-style dataset — advan_create_data","text":"Create ADVAN-style dataset","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_create_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create ADVAN-style dataset — advan_create_data","text":"","code":"advan_create_data( regimen, parameters, cmts = 5, t_obs = NULL, covariates = NULL, covariate_model = NULL )"},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_create_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create ADVAN-style dataset — advan_create_data","text":"regimen PKPDsim regimen parameters list parameters cmts number compartments, minimum 1. Default 5, enough linear PK models. OK compartments available actually used. t_obs add observation timepoints dataset covariates covariate list covariate_model covariate model equations, written C","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_create_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create ADVAN-style dataset — advan_create_data","text":"Data frame ADVAN-style data","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_parse_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal function to parse the raw output from ADVAN-style functions — advan_parse_output","title":"Internal function to parse the raw output from ADVAN-style functions — advan_parse_output","text":"Internal function parse raw output ADVAN-style functions","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_parse_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal function to parse the raw output from ADVAN-style functions — advan_parse_output","text":"","code":"advan_parse_output(data, cmts = 1, t_obs, extra_t_obs = TRUE, regimen)"},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_parse_output.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal function to parse the raw output from ADVAN-style functions — advan_parse_output","text":"data simulation output data cmts number compartments t_obs observation times extra_t_obs leave extra added dose times dataset? regimen PKPDsim regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_parse_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Internal function to parse the raw output from ADVAN-style functions — advan_parse_output","text":"Data frame containing parsed simulation data","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_process_infusion_doses.html","id":null,"dir":"Reference","previous_headings":"","what":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","title":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","text":"Function adapted code Abuhelwa, Foster, Upton JPET 2015. cleaned somewhat optimized. Can potentially optimized .","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_process_infusion_doses.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","text":"","code":"advan_process_infusion_doses(data)"},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_process_infusion_doses.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","text":"data ADVAN-style dataset, e.g. created using `advan_create_data`.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_process_infusion_doses.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","text":"Data frame containing additional RATEALL column.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_process_infusion_doses.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","text":"Abuhelwa, . Y., Foster, D. J. R., Upton, R. N. (2015) ADVAN-style analytical solutions common pharmacokinetic models. J Pharmacol Toxicol Methods 73:42-8. DOI: 10.1016/j.vascn.2015.03.004","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/analytical_eqn_wrapper.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrapper for using analytical equations with PKPD regimens — analytical_eqn_wrapper","title":"Wrapper for using analytical equations with PKPD regimens — analytical_eqn_wrapper","text":"development. Needs optimized significantly useful production.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/analytical_eqn_wrapper.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrapper for using analytical equations with PKPD regimens — analytical_eqn_wrapper","text":"","code":"analytical_eqn_wrapper(analytical, design = NULL, parameters)"},{"path":"https://insightrx.github.io/PKPDsim/reference/analytical_eqn_wrapper.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrapper for using analytical equations with PKPD regimens — analytical_eqn_wrapper","text":"analytical analytical equation, taking parameters `amt`, `parameters`, `t`, returning vector values `y` design design dataset created `sim_ode` parameters list parameters","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/apply_lagtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply lagtime to a regimen — apply_lagtime","title":"Apply lagtime to a regimen — apply_lagtime","text":"Apply lagtime regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/apply_lagtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply lagtime to a regimen — apply_lagtime","text":"","code":"apply_lagtime(regimen, lagtime, parameters, cmt_mapping = NULL)"},{"path":"https://insightrx.github.io/PKPDsim/reference/apply_lagtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply lagtime to a regimen — apply_lagtime","text":"regimen PKPDsim regimen lagtime lagtime object, either single value / parameter name vector values/parameter names compartments. parameters parameter list, required parameters specified. cmt_mapping map administration types compartments, e.g. `list(\"oral\" = 1, \"infusion\" = 2, \"bolus\" = 2)`.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/apply_lagtime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply lagtime to a regimen — apply_lagtime","text":"Original regimen lagtime added dose times","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/bioavailability_to_R_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Transforms bioavailability specs into appropriate R code — bioavailability_to_R_code","title":"Transforms bioavailability specs into appropriate R code — bioavailability_to_R_code","text":"Specialized wrapper around `vector_to_R_code` makes reasonable PK assumptions bioavailability specification NULL.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/bioavailability_to_R_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transforms bioavailability specs into appropriate R code — bioavailability_to_R_code","text":"","code":"bioavailability_to_R_code(bioav)"},{"path":"https://insightrx.github.io/PKPDsim/reference/bioavailability_to_R_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transforms bioavailability specs into appropriate R code — bioavailability_to_R_code","text":"bioav bioavailability specification, either NULL (assume value 1 compartments), single value (assume applies compartments), vector values.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/bioavailability_to_R_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Transforms bioavailability specs into appropriate R code — bioavailability_to_R_code","text":"character string length 1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_dydP.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate derivative — calc_dydP","title":"Calculate derivative — calc_dydP","text":"Calculate derivative","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_dydP.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate derivative — calc_dydP","text":"","code":"calc_dydP(dy, y, rel_delta, log_y)"},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_dydP.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate derivative — calc_dydP","text":"dy dy y dependent value rel_delta relative delta log_y logical indicating dependent variable log transformed","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_ss_analytic.html","id":null,"dir":"Reference","previous_headings":"","what":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","title":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","text":"Basically performs PK simulation using analytic equations instead ODEs steady state (n=45 days, increased needed).","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_ss_analytic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","text":"","code":"calc_ss_analytic( f = \"1cmt_oral\", dose, interval, t_inf = NULL, model, parameters, covariates = NULL, map = NULL, n_days = 45, n_transit_compartments = 0, auc = FALSE )"},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_ss_analytic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","text":"f analytic equation use, must one `names(advan_funcs)` dose dose interval interval t_inf infusion time model PKPDsim model parameters parameters list covariates covariates list map list remapping parameters, ex: `list(CL = \"CL\", V = \"V\")` n_days number days assume steady state. Default 45. n_transit_compartments number transit compartments, insert n compartments first (dose) compartment second (central) compartment. auc add (empty) AUC compartment end state vector?","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_ss_analytic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","text":"State vector linear pharmacokinetic system steady state","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_ss_analytic.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","text":"can also used models transit compartments, however, assumption made end dosing interval amount transit compartments negligible (0).","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calculate_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate model-specific variables using a dummy call to sim_ode() — calculate_parameters","title":"Calculate model-specific variables using a dummy call to sim_ode() — calculate_parameters","text":"convenience function PKPDsim users, used inside `sim_ode()`` function way. function useful converting estimated parameter actual parameter, e.g. clearance specified `CLi = CL * (WT/70) * (1/CR)` can used calculate `CLi` without write function second time R.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calculate_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate model-specific variables using a dummy call to sim_ode() — calculate_parameters","text":"","code":"calculate_parameters( ode = NULL, parameters = NULL, covariates = NULL, include_parameters = TRUE, include_variables = TRUE, ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/calculate_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate model-specific variables using a dummy call to sim_ode() — calculate_parameters","text":"ode PKPDsim model object parameters parameter list covariates covariate list. Make sure include covariates right time point, since last observed covariate values used. include_parameters boolean, include parameters? include_variables boolean, include variables? ... arguments pass simulation function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calculate_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate model-specific variables using a dummy call to sim_ode() — calculate_parameters","text":"List model-specific variables","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_iov_specification.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks that IOV was specified appropriately — check_iov_specification","title":"Checks that IOV was specified appropriately — check_iov_specification","text":"Inter-occasion variability (IOV) expected supplied list `cv` `n_bins` specified. `cv` expected named list IOV PK parameter. function checks ensure PK code ODE code contains IOV term PK parameter specified.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_iov_specification.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks that IOV was specified appropriately — check_iov_specification","text":"","code":"check_iov_specification(iov, code, pk_code)"},{"path":"https://insightrx.github.io/PKPDsim/reference/check_iov_specification.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks that IOV was specified appropriately — check_iov_specification","text":"iov IOV specifications, provided nested named list. code C++ ODE code, supplied string pk_code C++ PK code, supplied string","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_mixture_model.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that mixture model is specified in right format and within constraints (1 parameter, 2 groups) — check_mixture_model","title":"Check that mixture model is specified in right format and within constraints (1 parameter, 2 groups) — check_mixture_model","text":"Check mixture model specified right format within constraints (1 parameter, 2 groups)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_mixture_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that mixture model is specified in right format and within constraints (1 parameter, 2 groups) — check_mixture_model","text":"","code":"check_mixture_model(mixture, parameters)"},{"path":"https://insightrx.github.io/PKPDsim/reference/check_mixture_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that mixture model is specified in right format and within constraints (1 parameter, 2 groups) — check_mixture_model","text":"mixture mixture model specification (list, e.g. `list(\"CL\" = list(values=c(5, 10), probability=0.3))`) parameters vector parameter names","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_obs_input.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks obs input for valid combinations of cmt, var, scale — check_obs_input","title":"Checks obs input for valid combinations of cmt, var, scale — check_obs_input","text":"Checks obs input valid combinations cmt, var, scale","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_obs_input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks obs input for valid combinations of cmt, var, scale — check_obs_input","text":"","code":"check_obs_input(obs)"},{"path":"https://insightrx.github.io/PKPDsim/reference/check_obs_input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks obs input for valid combinations of cmt, var, scale — check_obs_input","text":"obs specified observation object including least description variable(s) associated particular compartment, e.g. `list(variable=\"CONC\", scale=\"1\")`.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/compile_sim_cpp.html","id":null,"dir":"Reference","previous_headings":"","what":"Compile ODE model to c++ function — compile_sim_cpp","title":"Compile ODE model to c++ function — compile_sim_cpp","text":"Compile ODE model c++ function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/compile_sim_cpp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compile ODE model to c++ function — compile_sim_cpp","text":"","code":"compile_sim_cpp( code, dose_code, pk_code, size, p, cpp_show_code, code_init = NULL, state_init = NULL, declare_variables = NULL, variables = NULL, covariates = NULL, obs = NULL, dose = NULL, iov = NULL, compile = TRUE, verbose = FALSE, as_is = FALSE )"},{"path":"https://insightrx.github.io/PKPDsim/reference/compile_sim_cpp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compile ODE model to c++ function — compile_sim_cpp","text":"code C++ code ODE system dose_code C++ code per dose event pk_code C++ code per event (similar $PK) size size ODE system p parameters (list) cpp_show_code show output c++ function? code_init code initialization state state_init state init vector declare_variables variable declaration required variables (including user-specified) variables user-specified variables covariates covariates specification obs observation specification dose dose specification iov iov specification compile compile ? verbose show output as_is use C-code -, substitute line-endings shift indices","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/compile_sim_cpp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compile ODE model to c++ function — compile_sim_cpp","text":"List containing ODE definition C++ code simulation function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariate_last_obs_only.html","id":null,"dir":"Reference","previous_headings":"","what":"Use only last observed covariate values — covariate_last_obs_only","title":"Use only last observed covariate values — covariate_last_obs_only","text":"Use last observed covariate values","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariate_last_obs_only.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use only last observed covariate values — covariate_last_obs_only","text":"","code":"covariate_last_obs_only(covariates)"},{"path":"https://insightrx.github.io/PKPDsim/reference/covariate_last_obs_only.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use only last observed covariate values — covariate_last_obs_only","text":"covariates covariates object","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariate_last_obs_only.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Use only last observed covariate values — covariate_last_obs_only","text":"List containing elements input covariate object including last value covariate","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariates_table_to_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert covariate table specified as data.frame — covariates_table_to_list","title":"Convert covariate table specified as data.frame — covariates_table_to_list","text":"Can handle time-varying data , `t` `time` specified column","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariates_table_to_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert covariate table specified as data.frame — covariates_table_to_list","text":"","code":"covariates_table_to_list(covariates_table, covariates_implementation = list())"},{"path":"https://insightrx.github.io/PKPDsim/reference/covariates_table_to_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert covariate table specified as data.frame — covariates_table_to_list","text":"covariates_table `data.frame`` covariates columns. Potentially `id` `t` columns covariates_implementation `list` implementation method per covariate","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariates_table_to_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert covariate table specified as data.frame — covariates_table_to_list","text":"List covariates","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/create_event_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Create an event table — create_event_table","title":"Create an event table — create_event_table","text":"Create event table","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/create_event_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create an event table — create_event_table","text":"","code":"create_event_table( regimen, t_max = NULL, t_obs = NULL, t_tte = NULL, t_init = 0, p, covariates, model = NULL, obs_type = NULL )"},{"path":"https://insightrx.github.io/PKPDsim/reference/create_event_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create an event table — create_event_table","text":"regimen regimen t_max t_max t_obs t_obs t_tte t_tte t_init t_init p parameters covariates covariates model model obs_type observation type","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/create_obs_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Create obs data — create_obs_data","title":"Create obs data — create_obs_data","text":"Used sim() arrange data ode() function correct format.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/create_obs_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create obs data — create_obs_data","text":"","code":"create_obs_data(ode_data, obs_attr, id)"},{"path":"https://insightrx.github.io/PKPDsim/reference/create_obs_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create obs data — create_obs_data","text":"ode_data data frame output ode() function obs_attr \"obs\" attribute ode() function id ID individual","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/cv_to_omega.html","id":null,"dir":"Reference","previous_headings":"","what":"Create lower-diagonal omega matrix from CV for parameter estimates — cv_to_omega","title":"Create lower-diagonal omega matrix from CV for parameter estimates — cv_to_omega","text":"Create lower-diagonal omega matrix CV parameter estimates","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/cv_to_omega.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create lower-diagonal omega matrix from CV for parameter estimates — cv_to_omega","text":"","code":"cv_to_omega(par_cv = NULL, parameters = NULL)"},{"path":"https://insightrx.github.io/PKPDsim/reference/cv_to_omega.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create lower-diagonal omega matrix from CV for parameter estimates — cv_to_omega","text":"par_cv list parameter CVs parameters list parameters","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/cv_to_omega.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create lower-diagonal omega matrix from CV for parameter estimates — cv_to_omega","text":"vector describing lower triangle omega (-subject variability) matrix","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/define_tdm_init_model.html","id":null,"dir":"Reference","previous_headings":"","what":"defines C code for TDM before dose conditions — define_tdm_init_model","title":"defines C code for TDM before dose conditions — define_tdm_init_model","text":"Currently available 1-cmt 2-cmt IV models","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/define_tdm_init_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"defines C code for TDM before dose conditions — define_tdm_init_model","text":"","code":"define_tdm_init_model(def)"},{"path":"https://insightrx.github.io/PKPDsim/reference/define_tdm_init_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"defines C code for TDM before dose conditions — define_tdm_init_model","text":"def model definition, named recursive list least objects `misc$model_type`, `parameters` `variables`","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/define_tdm_init_model.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"defines C code for TDM before dose conditions — define_tdm_init_model","text":"model defintion `state_init` object added describing initializing compartments.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/detect_ode_syntax.html","id":null,"dir":"Reference","previous_headings":"","what":"Auto-detect the syntax for the ODE code — detect_ode_syntax","title":"Auto-detect the syntax for the ODE code — detect_ode_syntax","text":"Either PKPDsim RxODE","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/detect_ode_syntax.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Auto-detect the syntax for the ODE code — detect_ode_syntax","text":"","code":"detect_ode_syntax(code)"},{"path":"https://insightrx.github.io/PKPDsim/reference/detect_ode_syntax.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Auto-detect the syntax for the ODE code — detect_ode_syntax","text":"code character string ODE code","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/detect_ode_syntax.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Auto-detect the syntax for the ODE code — detect_ode_syntax","text":"List elements indicating syntax ODE code","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/f_cov.html","id":null,"dir":"Reference","previous_headings":"","what":"covariate function builder — f_cov","title":"covariate function builder — f_cov","text":"covariate function builder","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/f_cov.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"covariate function builder — f_cov","text":"","code":"f_cov(...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/f_cov.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"covariate function builder — f_cov","text":"... parameters pass cov","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/f_cov.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"covariate function builder — f_cov","text":"Covariate function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_fixed_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Get fixed parameters — get_fixed_parameters","title":"Get fixed parameters — get_fixed_parameters","text":"Get fixed parameters listed model definition.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_fixed_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get fixed parameters — get_fixed_parameters","text":"","code":"get_fixed_parameters(def)"},{"path":"https://insightrx.github.io/PKPDsim/reference/get_fixed_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get fixed parameters — get_fixed_parameters","text":"def Model definition output read_model_json()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_ode_model_size.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the number of states in the ODE from the code\ncode C++ code for model — get_ode_model_size","title":"Get the number of states in the ODE from the code\ncode C++ code for model — get_ode_model_size","text":"Get number states ODE code code C++ code model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_ode_model_size.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the number of states in the ODE from the code\ncode C++ code for model — get_ode_model_size","text":"","code":"get_ode_model_size(code)"},{"path":"https://insightrx.github.io/PKPDsim/reference/get_ode_model_size.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the number of states in the ODE from the code\ncode C++ code for model — get_ode_model_size","text":"code C++ code","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_ode_model_size.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the number of states in the ODE from the code\ncode C++ code for model — get_ode_model_size","text":"Number states ODE model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_parameters_from_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Get model parameters from code — get_parameters_from_code","title":"Get model parameters from code — get_parameters_from_code","text":"Get model parameters code","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_parameters_from_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get model parameters from code — get_parameters_from_code","text":"","code":"get_parameters_from_code(code, state_init, declare_variables = NULL)"},{"path":"https://insightrx.github.io/PKPDsim/reference/get_parameters_from_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get model parameters from code — get_parameters_from_code","text":"code code state_init state init vector declare_variables declared variables","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_parameters_from_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get model parameters from code — get_parameters_from_code","text":"Vector parameter names","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_t_obs_from_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract sensible default observation times from a specified regimen — get_t_obs_from_regimen","title":"Extract sensible default observation times from a specified regimen — get_t_obs_from_regimen","text":"Extract sensible default observation times specified regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_t_obs_from_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract sensible default observation times from a specified regimen — get_t_obs_from_regimen","text":"","code":"get_t_obs_from_regimen( regimen = NULL, obs_step_size = NULL, t_max = NULL, covariates = NULL, extra_t_obs = NULL, t_init = 0 )"},{"path":"https://insightrx.github.io/PKPDsim/reference/get_t_obs_from_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract sensible default observation times from a specified regimen — get_t_obs_from_regimen","text":"regimen regimen created using `new_regimen()` obs_step_size step size observations. auto-calculated NULL t_max max time value covariates covariates object, created using `list(new_covariate(), ...)` extra_t_obs add timepoints t_obs covariate changing (`T`/`F`) t_init time initiation ODE system. Usually 0.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_var_y.html","id":null,"dir":"Reference","previous_headings":"","what":"Get expected variance/sd/ci of dependent variable\nbased on PKPDsim model, parameters, and regimen — get_var_y","title":"Get expected variance/sd/ci of dependent variable\nbased on PKPDsim model, parameters, and regimen — get_var_y","text":"Get expected variance/sd/ci dependent variable based PKPDsim model, parameters, regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_var_y.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get expected variance/sd/ci of dependent variable\nbased on PKPDsim model, parameters, and regimen — get_var_y","text":"","code":"get_var_y( model = NULL, parameters = list(), regimen = list(), t_obs = c(1:48), obs_comp = NULL, obs_variable = NULL, omega = c(0.1, 0.05, 0.1), omega_full = NULL, n_ind = NULL, ruv = NULL, y = NULL, rel_delta = 1e-04, method = \"delta\", sequence = NULL, auc = FALSE, sd = TRUE, q = NULL, in_parallel = FALSE, n_cores = 3, return_all = FALSE, ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/get_var_y.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get expected variance/sd/ci of dependent variable\nbased on PKPDsim model, parameters, and regimen — get_var_y","text":"model model, created using `PKPDsim::new_ode_model()` parameters parameters list regimen regimen, created using `PKPDsim::new_regimen()` t_obs vector observation times obs_comp observation compartment. NULL \"obs\" (default) obs_variable observation variable. NULL, ignored, otherwise override `obs_comp`. omega triangle omega block omega_full full omega block n_ind number individuals simulate sim method ruv residual variability, supplied named list, ex: `list(prop = 0, add = 0, exp = 0)` y vector observations. NULL, new simulation performed. rel_delta rel_delta method method, `delta` `sim` sequence simulations, NULL pseudo-random sequence use, e.g. \"halton\" \"sobol\". See `mvrnorm2` details. auc AUC? sd return standard deviation (`TRUE`) variance (`FALSE`) q return vector quantiles instead sd/var. return parametric quantiles delta-method used, non-parametric simulation-based methods. in_parallel run simulations parallel? n_cores run parallel, many cores? return_all return object relevant information? ... passed `sim_ode()`","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_var_y.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get expected variance/sd/ci of dependent variable\nbased on PKPDsim model, parameters, and regimen — get_var_y","text":"Vector standard deviations variances (quantiles thereof) dependent value variable","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ifelse0.html","id":null,"dir":"Reference","previous_headings":"","what":"ifelse function but then based on whether value is NULL or not — ifelse0","title":"ifelse function but then based on whether value is NULL or not — ifelse0","text":"ifelse function based whether value NULL ","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ifelse0.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ifelse function but then based on whether value is NULL or not — ifelse0","text":"","code":"ifelse0(value = NULL, alternative = NULL, allow_null = FALSE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ifelse0.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ifelse function but then based on whether value is NULL or not — ifelse0","text":"value metadata list object alternative alternative value allow_null can alternative NULL?","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ifelse0.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ifelse function but then based on whether value is NULL or not — ifelse0","text":"value non-NULL; alternative otherwise","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/is_newer_package.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if package number is different from currently installed,\nand provide some messaging. — is_newer_package","title":"Check if package number is different from currently installed,\nand provide some messaging. — is_newer_package","text":"Technically checks package version different, necessarily higher version number.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/is_newer_package.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if package number is different from currently installed,\nand provide some messaging. — is_newer_package","text":"","code":"is_newer_package(package, new_version)"},{"path":"https://insightrx.github.io/PKPDsim/reference/is_newer_package.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if package number is different from currently installed,\nand provide some messaging. — is_newer_package","text":"package R package new_version new version number","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/is_positive_definite.html","id":null,"dir":"Reference","previous_headings":"","what":"Is matrix positive definite — is_positive_definite","title":"Is matrix positive definite — is_positive_definite","text":"matrix positive definite","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/is_positive_definite.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is matrix positive definite — is_positive_definite","text":"","code":"is_positive_definite(x)"},{"path":"https://insightrx.github.io/PKPDsim/reference/is_positive_definite.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is matrix positive definite — is_positive_definite","text":"x matrix, specified either vector lower triangle, full matrix (matrix class)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/is_positive_definite.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is matrix positive definite — is_positive_definite","text":"TRUE x positive definite; FALSE otherwise.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_cov_and_par.html","id":null,"dir":"Reference","previous_headings":"","what":"Combines covariates and parameters into a single list, useful for reparametrization of the model. — join_cov_and_par","title":"Combines covariates and parameters into a single list, useful for reparametrization of the model. — join_cov_and_par","text":"Combines covariates parameters single list, useful reparametrization model.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_cov_and_par.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combines covariates and parameters into a single list, useful for reparametrization of the model. — join_cov_and_par","text":"","code":"join_cov_and_par(covs, pars)"},{"path":"https://insightrx.github.io/PKPDsim/reference/join_cov_and_par.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combines covariates and parameters into a single list, useful for reparametrization of the model. — join_cov_and_par","text":"covs covariates object pars model parameters, output `parameters()` call frmo model library.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_cov_and_par.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combines covariates and parameters into a single list, useful for reparametrization of the model. — join_cov_and_par","text":"List containing covariates parameters","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Join two dosing regimens — join_regimen","title":"Join two dosing regimens — join_regimen","text":"Join two dosing regimens","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Join two dosing regimens — join_regimen","text":"","code":"join_regimen( regimen1 = NULL, regimen2 = NULL, interval = NULL, dose_update = NULL, t_dose_update = NULL, continuous = FALSE )"},{"path":"https://insightrx.github.io/PKPDsim/reference/join_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Join two dosing regimens — join_regimen","text":"regimen1 first regimen regimen2 second regimen interval interval regimen1 regimen2 (dose_update specified) dose_update dose number override regimen1 regimen 2 (interval specified) t_dose_update dose time update regimen continuous joining continuous infusions","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Join two dosing regimens — join_regimen","text":"Joined regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/lower_triangle_mat_size.html","id":null,"dir":"Reference","previous_headings":"","what":"Size of the lower triangle of the matrix — lower_triangle_mat_size","title":"Size of the lower triangle of the matrix — lower_triangle_mat_size","text":"Size lower triangle matrix","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/lower_triangle_mat_size.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Size of the lower triangle of the matrix — lower_triangle_mat_size","text":"","code":"lower_triangle_mat_size(mat)"},{"path":"https://insightrx.github.io/PKPDsim/reference/lower_triangle_mat_size.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Size of the lower triangle of the matrix — lower_triangle_mat_size","text":"mat omega matrix vector","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/merge_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Merge two regimens together. — merge_regimen","title":"Merge two regimens together. — merge_regimen","text":"contrast `join_regimen`, joins two consecutive regimens together, `merge_regimen` merges two regimens given time. can e.g. used define regimens multi-drug models.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/merge_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Merge two regimens together. — merge_regimen","text":"","code":"merge_regimen(regimens)"},{"path":"https://insightrx.github.io/PKPDsim/reference/merge_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Merge two regimens together. — merge_regimen","text":"regimens List PKPDsim regimens created `new_regimen`.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/merge_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Merge two regimens together. — merge_regimen","text":"Merged regimens","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_from_api.html","id":null,"dir":"Reference","previous_headings":"","what":"Load model definition from API, and compile to R library — model_from_api","title":"Load model definition from API, and compile to R library — model_from_api","text":"Load model definition API, compile R library","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_from_api.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Load model definition from API, and compile to R library — model_from_api","text":"","code":"model_from_api( url, model = NULL, nonmem = NULL, verbose = TRUE, get_definition = FALSE, to_package = FALSE, force = FALSE, install_all = FALSE, ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/model_from_api.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load model definition from API, and compile to R library — model_from_api","text":"url URL file path JSON representation model model model id (used messages) nonmem URL file path NONMEM file verbose verbosity (T/F) get_definition return model definition, compile to_package compile package? force force install even version number model already installed. install_all force install , even model inactive ... arguments passed new_ode_model() function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_from_api.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Load model definition from API, and compile to R library — model_from_api","text":"Model object created new_ode_model()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_library.html","id":null,"dir":"Reference","previous_headings":"","what":"Model library — model_library","title":"Model library — model_library","text":"Model library","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_library.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Model library — model_library","text":"","code":"model_library(name = NULL)"},{"path":"https://insightrx.github.io/PKPDsim/reference/model_library.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Model library — model_library","text":"name name model library. none specified, show list available models.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_library.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Model library — model_library","text":"List containing information named model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/mvrnorm2.html","id":null,"dir":"Reference","previous_headings":"","what":"More powerful multivariate normal sampling function — mvrnorm2","title":"More powerful multivariate normal sampling function — mvrnorm2","text":"Besides standard multivariate normal sampling (mvrnorm), allows exponential multivariate normal quasi-random multivariate normal (using randtoolbox) using interface.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/mvrnorm2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"More powerful multivariate normal sampling function — mvrnorm2","text":"","code":"mvrnorm2(n, mu, Sigma, exponential = FALSE, sequence = NULL, ...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/mvrnorm2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"More powerful multivariate normal sampling function — mvrnorm2","text":"n number samples mu mean Sigma covariance matrix exponential exponential distribution (.e. multiply mu exponential sampled numbers) sequence sequence available randtoolbox, e.g. `halton`, `sobol` ... parameters passed mvrnorm randtoolbox sequence generator","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/mvrnorm2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"More powerful multivariate normal sampling function — mvrnorm2","text":"Multivariate normal samples","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/na_locf.html","id":null,"dir":"Reference","previous_headings":"","what":"Fill in NAs with the previous non-missing value — na_locf","title":"Fill in NAs with the previous non-missing value — na_locf","text":"Inspired zoo::na.locf0","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/na_locf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fill in NAs with the previous non-missing value — na_locf","text":"","code":"na_locf(object, fromLast = FALSE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/na_locf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fill in NAs with the previous non-missing value — na_locf","text":"object object fromLast logical. Causes observations carried backward rather forward. Default FALSE.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/na_locf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fill in NAs with the previous non-missing value — na_locf","text":"Original object NAs filled ","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_adherence.html","id":null,"dir":"Reference","previous_headings":"","what":"Probabilistically model adherence — new_adherence","title":"Probabilistically model adherence — new_adherence","text":"Model drug adherence using either binomial probability distribution markov chain model based probability staying adherent becoming adherent non-adherent.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_adherence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Probabilistically model adherence — new_adherence","text":"","code":"new_adherence( n = 100, type = c(\"markov\", \"binomial\"), p_markov_remain_ad = 0.75, p_markov_become_ad = 0.75, p_binom = 0.7 )"},{"path":"https://insightrx.github.io/PKPDsim/reference/new_adherence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Probabilistically model adherence — new_adherence","text":"n number occasions simulate type type adherence simulation, either \"markov\" \"binomial\" p_markov_remain_ad markov probability staying adherent p_markov_become_ad markov probability going non-adherent adherent state p_binom binomial probability adherent","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_adherence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Probabilistically model adherence — new_adherence","text":"Returns vector length `n` containing values 0 (non-adherent) 1 (adherent). Numeric vector length n","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate.html","id":null,"dir":"Reference","previous_headings":"","what":"New covariate — new_covariate","title":"New covariate — new_covariate","text":"Describe data covariate, either fixed time-variant","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"New covariate — new_covariate","text":"","code":"new_covariate( value = NULL, times = NULL, implementation = c(\"interpolate\", \"locf\"), unit = NULL, interpolation_join_limit = 1, remove_negative_times = TRUE, round_times = NULL, comments = NULL, verbose = TRUE )"},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"New covariate — new_covariate","text":"value numeric vector times NULL time-invariant covariate numeric vector specifying update times covariate implementation time-varying covariates either 'locf' (last observation carried forward) 'interpolate' (default). Non-numeric covariate values assumed locf. unit specify covariate unit (optional, documentation purposes ) interpolation_join_limit interpolate option, covariate timepoints spaced close together, ODE solver sometimes chokes. argument sets lower limit space timepoints. create average values joint timepoints instead. undesired set NULL 0. remove_negative_times times zero discarded (value time zero determined based implementation argument), TRUE FALSE. round_times round times specified number digits. NULL, round. comments NULL, vector length equal value specifying comments observation (optional, documentation ) verbose verbosity","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"New covariate — new_covariate","text":"Object class \"covariate\"","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate_model.html","id":null,"dir":"Reference","previous_headings":"","what":"covariate model function — new_covariate_model","title":"covariate model function — new_covariate_model","text":"covariate model function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"covariate model function — new_covariate_model","text":"","code":"new_covariate_model(model = list())"},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"covariate model function — new_covariate_model","text":"model covariate model specified list","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate_model.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"covariate model function — new_covariate_model","text":"List containing model function(s)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_ode_model.html","id":null,"dir":"Reference","previous_headings":"","what":"Create new ODE model — new_ode_model","title":"Create new ODE model — new_ode_model","text":"Create new ODE model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_ode_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create new ODE model — new_ode_model","text":"","code":"new_ode_model( model = NULL, code = NULL, pk_code = NULL, dose_code = NULL, file = NULL, func = NULL, state_init = NULL, parameters = NULL, reparametrization = NULL, mixture = NULL, units = NULL, size = NULL, lagtime = NULL, obs = list(cmt = 1, scale = 1), dose = list(cmt = 1), covariates = NULL, declare_variables = NULL, iiv = NULL, iov = NULL, development = NULL, omega_matrix = NULL, ruv = NULL, ltbs = NULL, misc = NULL, cmt_mapping = NULL, int_step_size = NULL, default_parameters = NULL, fixed = NULL, cpp_show_code = FALSE, package = NULL, test_file = NULL, install = TRUE, folder = NULL, lib_location = NULL, verbose = FALSE, as_is = FALSE, nonmem = NULL, comments = NULL, version = \"0.1.0\", quiet = \"\", definition = NULL )"},{"path":"https://insightrx.github.io/PKPDsim/reference/new_ode_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create new ODE model — new_ode_model","text":"model model name model library code C++ code specifying ODE system pk_code C++ code called event dose_code C++ code called dose event file file containing C++ code func R function used deSolve library state_init vector state init parameters list vector parameter values reparametrization list parameters definitions reparametrize linear PK model 1-, 2- o4 3-compartment PK standardized parametrization. mixture mixture models, provide list parameter associated mixture possible values probabilities (first value), e.g. `list(CL = list(value = c(10, 20), probability = 0.3)`. units list vector parameter units size size state vector model. Size extracted automatically supplied code, use argument override. lagtime lag time obs list \"scale\": character string definition scale, e.g. \"V\" \"V*(WT/70)\". NULL, scale defaults 1., \"cmt\" observation compartment dose specify default dose compartment, e.g. list(cmt = 1) covariates specify covariates, either character vector list. specified list, allows use timevarying covariates (see `new_covariate()` function info) declare_variables declare variables iiv inter-individual variability, can optionally added library iov inter-occasion variability, can optionally added library development Information model development population, can optionally added library omega_matrix variance-covariance matrix inter-individual variability, can optionally added library ruv residual variability, can optionally added library ltbs log-transform sides. used simulations, fitting (sets attribute `ltbs`). misc list miscellaneous model metadata cmt_mapping list indicating administration routes apply compartments. Example: `list(\"oral\" = 1, \"infusion\" = 2)` int_step_size step size integrator. Can pre-specified model, override default `sim_ode()` default_parameters population specific patient values, can optionally added library fixed parameters iiv added. cpp_show_code show generated C++ code package package name saving package test_file optional test file included package install install package compilation? folder base folder name create package lib_location install folder (`--library` argument) verbose show output as_is use C-code -, substitute line-endings shift indices nonmem add nonmem code attribute model object comments comments model version number library quiet passed `system2` setting stderr stdout; output cmd line output. Default (`\"\"`) R console, NULL FALSE discards. TRUE captures output saves file. definition optional, filename JSON file full definition model. definition file stored `definition.json` resulting package.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_ode_model.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create new ODE model — new_ode_model","text":"package name NULL, returns model object. Otherwise return value.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Dose regimen for sim_ode — new_regimen","title":"Dose regimen for sim_ode — new_regimen","text":"Create dosing regimen use sim_ode","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dose regimen for sim_ode — new_regimen","text":"","code":"new_regimen( amt = 100, interval = NULL, n = 3, times = NULL, type = NULL, t_inf = NULL, rate = NULL, t_lag = NULL, cmt = NULL, checks = TRUE, ss = FALSE, n_ss = NULL, first_dose_time = now_utc() )"},{"path":"https://insightrx.github.io/PKPDsim/reference/new_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dose regimen for sim_ode — new_regimen","text":"amt dosing amount, either single value (repeated multiple doses), vector doses administration interval dosing interval (requires n argument) n number doses (requires interval argument) times vector describing dosing times. Overrides specified times using interval n arguments type either \"infusion\", \"bolus\", \"oral\", \"sc\" (subcutaneous), \"im\" (intramuscular). t_inf infusion time (`type`==`infusion`) rate infusion rate (`type`==`infusion`). `NULL` default. specified, overrides `t_inf` t_lag lag time (can applied dose type, oral). just added `times` cmt vector dosing compartments (optional, NULL dosing compartment defined model used) checks input checks. Remove increase speed (e.g. population-level estimation optimal design) ss steady state? boolean value whether simulate steady state first (steady state based specified `amt` `interval`, `times` ignored). n_ss many doses simulate assumed steady state. Default 4 * 24 / `interval`. first_dose_time datetime stamp first dose (class `POSIXct`). Default current date time.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dose regimen for sim_ode — new_regimen","text":"list containing calculated VPC information, ggplot2 object","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/new_regimen.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dose regimen for sim_ode — new_regimen","text":"","code":"r1 <- new_regimen(amt=50, interval=12, n=20) # dose 50mg, q12hrs for 10 days r2 <- new_regimen(amt=50, times=c(0:19)*12) # same, but using explicit times r3 <- new_regimen(amt=c(rep(100,4), rep(50,16)), times=c(0:19)*12) # first 4 doses higher dose"},{"path":"https://insightrx.github.io/PKPDsim/reference/nlmixr_parse_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to parse parameters for a model into a structure used by nlmixr — nlmixr_parse_parameters","title":"Function to parse parameters for a model into a structure used by nlmixr — nlmixr_parse_parameters","text":"Function parse parameters model structure used nlmixr","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/nlmixr_parse_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to parse parameters for a model into a structure used by nlmixr — nlmixr_parse_parameters","text":"","code":"nlmixr_parse_parameters( parameters = list(CL = 5, V = 50), omega = c(0.1, 0.05, 0.1), res_var = list(prop = 0.1, add = 1), fixed = c(), log_transform = TRUE, ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/nlmixr_parse_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to parse parameters for a model into a structure used by nlmixr — nlmixr_parse_parameters","text":"parameters list parameters omega vector describing lower-diagonal -subject variability matrix res_var residual variability. Expected list arguments `prop`, `add`, /`exp`. NULL default. fixed vector fixed parameters log_transform log-transform estimated parameters nlmixr? ... passed ","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/nlmixr_parse_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to parse parameters for a model into a structure used by nlmixr — nlmixr_parse_parameters","text":"List parameters can used nlmixr","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/nm_to_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a regimen from NONMEM data — nm_to_regimen","title":"Create a regimen from NONMEM data — nm_to_regimen","text":"Create regimen based NONMEM, NONMEM-like dataset","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/nm_to_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a regimen from NONMEM data — nm_to_regimen","text":"","code":"nm_to_regimen(data, reset_time = TRUE, first_only = FALSE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/nm_to_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a regimen from NONMEM data — nm_to_regimen","text":"data NONMEM-type dataset reset_time start time simulated patient 0, irrespective design dataset first_only use design first individual dataset","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/nm_to_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a regimen from NONMEM data — nm_to_regimen","text":"Regimen object","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/now_utc.html","id":null,"dir":"Reference","previous_headings":"","what":"Current time in UTC — now_utc","title":"Current time in UTC — now_utc","text":"Current time UTC","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/now_utc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Current time in UTC — now_utc","text":"","code":"now_utc()"},{"path":"https://insightrx.github.io/PKPDsim/reference/now_utc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Current time in UTC — now_utc","text":"POSIXct object containing current time UTC","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/parse_obs_types.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse observation types to simulation code — parse_obs_types","title":"Parse observation types to simulation code — parse_obs_types","text":"Parse observation types simulation code","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/parse_obs_types.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse observation types to simulation code — parse_obs_types","text":"","code":"parse_obs_types(obs, initial = FALSE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/parse_obs_types.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse observation types to simulation code — parse_obs_types","text":"obs specified observation object including least description variable(s) associated particular compartment, e.g. `list(variable=\"CONC\", scale=\"1\")`. initial initial code block C++ template initializes variables compartments (`TRUE`), second code block used rest dataset?","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pkdata.html","id":null,"dir":"Reference","previous_headings":"","what":"PK dataset — pkdata","title":"PK dataset — pkdata","text":"Example PK dataset","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pkdata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"PK dataset — pkdata","text":"","code":"pkdata"},{"path":"https://insightrx.github.io/PKPDsim/reference/pkdata.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"PK dataset — pkdata","text":"data frame 624 rows 12 variables NONMEM format","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pkpdsim_to_nlmixr.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a model generated with PKPDsim to an object for nlmixr — pkpdsim_to_nlmixr","title":"Convert a model generated with PKPDsim to an object for nlmixr — pkpdsim_to_nlmixr","text":"Convert model generated PKPDsim object nlmixr","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pkpdsim_to_nlmixr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a model generated with PKPDsim to an object for nlmixr — pkpdsim_to_nlmixr","text":"","code":"pkpdsim_to_nlmixr( model = NULL, parameters = NULL, omega = NULL, res_var = NULL, fixed = c(), ini_code = NULL, model_code = NULL, model_par_code = NULL, verbose = FALSE, ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/pkpdsim_to_nlmixr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a model generated with PKPDsim to an object for nlmixr — pkpdsim_to_nlmixr","text":"model PKPDsim model parameters list parameters omega vector describing lower-diagonal -subject variability matrix res_var residual variability. Expected list arguments `prop`, `add`, /`exp`. NULL default. fixed vector fixed (estimated) parameter names ini_code manually specify `ini` block nlmixr model_code manually specify `model` block nlmixr model_par_code manually specify parameters section inside `model` block nlmixr verbose verbose, `TRUE` `FALSE` ... passed ","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pkpdsim_to_nlmixr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert a model generated with PKPDsim to an object for nlmixr — pkpdsim_to_nlmixr","text":"nlmixr function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pop_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove n doses (from tail) of PKPDsim regimen — pop_regimen","title":"Remove n doses (from tail) of PKPDsim regimen — pop_regimen","text":"Opposite shift_regimen()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pop_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove n doses (from tail) of PKPDsim regimen — pop_regimen","text":"","code":"pop_regimen(regimen, n = 1)"},{"path":"https://insightrx.github.io/PKPDsim/reference/pop_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove n doses (from tail) of PKPDsim regimen — pop_regimen","text":"regimen PKPDsim regimen created using `new_regimen()` n number doses pop regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pop_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove n doses (from tail) of PKPDsim regimen — pop_regimen","text":"Input regiment minus selected number doses","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/print.PKPDsim.html","id":null,"dir":"Reference","previous_headings":"","what":"Print function for PKPDsim simulation function — print.PKPDsim","title":"Print function for PKPDsim simulation function — print.PKPDsim","text":"Print function PKPDsim simulation function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.PKPDsim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print function for PKPDsim simulation function — print.PKPDsim","text":"","code":"# S3 method for PKPDsim print(x, ...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/print.PKPDsim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print function for PKPDsim simulation function — print.PKPDsim","text":"x function ... additional arguments","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.PKPDsim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print function for PKPDsim simulation function — print.PKPDsim","text":"return value, print function.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.covariate.html","id":null,"dir":"Reference","previous_headings":"","what":"Print function for PKPDsim covariate object — print.covariate","title":"Print function for PKPDsim covariate object — print.covariate","text":"Print function PKPDsim covariate object","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.covariate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print function for PKPDsim covariate object — print.covariate","text":"","code":"# S3 method for covariate print(x, ...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/print.covariate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print function for PKPDsim covariate object — print.covariate","text":"x covariate object ... additional arguments","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.covariate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print function for PKPDsim covariate object — print.covariate","text":"return value, print function.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Print function for PKPDsim regimen — print.regimen","title":"Print function for PKPDsim regimen — print.regimen","text":"Print function PKPDsim regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print function for PKPDsim regimen — print.regimen","text":"","code":"# S3 method for regimen print(x, ...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/print.regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print function for PKPDsim regimen — print.regimen","text":"x regimen ... arguments pass","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print function for PKPDsim regimen — print.regimen","text":"return value, print function.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a list in R syntax — print_list","title":"Return a list in R syntax — print_list","text":"Return list R syntax","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a list in R syntax — print_list","text":"","code":"print_list(x, wrapper = TRUE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/print_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a list in R syntax — print_list","text":"x list printed wrapper wrap list object?","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a list in R syntax — print_list","text":"Original list R syntax","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/read_model_json.html","id":null,"dir":"Reference","previous_headings":"","what":"Read model definition from JSON — read_model_json","title":"Read model definition from JSON — read_model_json","text":"substitution escaped characters strings JSON file, converts list jsonlite::fromJSON()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/read_model_json.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read model definition from JSON — read_model_json","text":"","code":"read_model_json(path)"},{"path":"https://insightrx.github.io/PKPDsim/reference/read_model_json.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read model definition from JSON — read_model_json","text":"path Path JSON file","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/read_model_json.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read model definition from JSON — read_model_json","text":"List containing contents original JSON file","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/regimen_to_nm.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert PKPDsim regimen to NONMEM table (doses only) — regimen_to_nm","title":"Convert PKPDsim regimen to NONMEM table (doses only) — regimen_to_nm","text":"Convert PKPDsim regimen NONMEM table (doses )","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/regimen_to_nm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert PKPDsim regimen to NONMEM table (doses only) — regimen_to_nm","text":"","code":"regimen_to_nm( reg = NULL, dose_cmt = 1, n_ind = 1, t_obs = NULL, obs_cmt = 1, bioav = NULL )"},{"path":"https://insightrx.github.io/PKPDsim/reference/regimen_to_nm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert PKPDsim regimen to NONMEM table (doses only) — regimen_to_nm","text":"reg `PKPDsim` regimen, created using `new_regimen()` function dose_cmt dosing compartment, specified `reg` object n_ind repeat `n_ind` subjects t_obs add observation time(s) obs_cmt observation compartment added observation time(s) bioav bioavailability (numeric vector, can parameter)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/regimen_to_nm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert PKPDsim regimen to NONMEM table (doses only) — regimen_to_nm","text":"Data frame containing doses","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/reparametrize.html","id":null,"dir":"Reference","previous_headings":"","what":"Reparametrize model parameters using a reparametrization defined within the model. — reparametrize","title":"Reparametrize model parameters using a reparametrization defined within the model. — reparametrize","text":"Mostly useful reparametrizing models standard parametrizations, e.g. NONMEM TRANS clinPK parametrizations.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/reparametrize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reparametrize model parameters using a reparametrization defined within the model. — reparametrize","text":"","code":"reparametrize(model, parameters, covariates)"},{"path":"https://insightrx.github.io/PKPDsim/reference/reparametrize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reparametrize model parameters using a reparametrization defined within the model. — reparametrize","text":"model PKPDsim model, compiled using `reparametrization` argument metadata object. parameters list model parameters covariates covariates list, specified PKPDsim covariates","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/reparametrize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reparametrize model parameters using a reparametrization defined within the model. — reparametrize","text":"Reparameterized model parameters","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/search_replace_in_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Find string and replace in file — search_replace_in_file","title":"Find string and replace in file — search_replace_in_file","text":"Find string replace file","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/search_replace_in_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find string and replace in file — search_replace_in_file","text":"","code":"search_replace_in_file(files = c(), find = NULL, replacement = NULL)"},{"path":"https://insightrx.github.io/PKPDsim/reference/search_replace_in_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find string and replace in file — search_replace_in_file","text":"files vector files find find string, vector character replacement replace , vector character, equal length `find`","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/search_replace_in_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find string and replace in file — search_replace_in_file","text":"Function return value edits files disk","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove n doses (from start) of PKPDsim regimen — shift_regimen","title":"Remove n doses (from start) of PKPDsim regimen — shift_regimen","text":"Opposite pop_regimen()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove n doses (from start) of PKPDsim regimen — shift_regimen","text":"","code":"shift_regimen(regimen, n = 1, reset_time = TRUE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove n doses (from start) of PKPDsim regimen — shift_regimen","text":"regimen PKPDsim regimen created using `new_regimen()` n number doses shift regimen reset_time reset remaining doses start t=0?","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove n doses (from start) of PKPDsim regimen — shift_regimen","text":"Regimen selected number doses removed start","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_state_indices.html","id":null,"dir":"Reference","previous_headings":"","what":"R starts counting vector indices at 1, c++ starts at 0,\nso reduce all state numbers in the Cpp function definition by 1 — shift_state_indices","title":"R starts counting vector indices at 1, c++ starts at 0,\nso reduce all state numbers in the Cpp function definition by 1 — shift_state_indices","text":"R starts counting vector indices 1, c++ starts 0, reduce state numbers Cpp function definition 1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_state_indices.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"R starts counting vector indices at 1, c++ starts at 0,\nso reduce all state numbers in the Cpp function definition by 1 — shift_state_indices","text":"","code":"shift_state_indices(ode_def, n = -1)"},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_state_indices.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"R starts counting vector indices at 1, c++ starts at 0,\nso reduce all state numbers in the Cpp function definition by 1 — shift_state_indices","text":"ode_def ODE definition n add/subtract number, default = -1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate ODE or analytical equation — sim","title":"Simulate ODE or analytical equation — sim","text":"Simulates specified regimen using ODE system analytical equation","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate ODE or analytical equation — sim","text":"","code":"sim( ode = NULL, analytical = NULL, parameters = NULL, parameters_table = NULL, mixture_group = NULL, omega = NULL, omega_type = \"exponential\", res_var = NULL, iov_bins = NULL, seed = NULL, sequence = NULL, n_ind = 1, event_table = NULL, regimen = NULL, lagtime = NULL, covariates = NULL, covariates_table = NULL, covariates_implementation = list(), covariate_model = NULL, A_init = NULL, only_obs = FALSE, obs_step_size = NULL, int_step_size = 0.01, t_max = NULL, t_obs = NULL, t_tte = NULL, t_init = 0, obs_type = NULL, duplicate_t_obs = FALSE, extra_t_obs = TRUE, rtte = FALSE, checks = TRUE, verbose = FALSE, return_event_table = FALSE, return_design = FALSE, output_include = list(parameters = FALSE, covariates = FALSE), ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/sim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate ODE or analytical equation — sim","text":"ode function describing ODE system analytical string specifying analytical equation model use (similar ADVAN1-5 NONMEM). specified, use ODEs. parameters model parameters parameters_table dataframe parameters (parameters columns) containing parameter estimates individuals simulate. Formats accepted: data.frame, data.table, list lists. mixture_group mixture group models containing mixtures. either `1` `2`, since two groups currently allowed. omega vector describing lower-diagonal -subject variability matrix omega_type exponential normal, specified vector res_var residual variability. Expected list arguments `prop`, `add`, /`exp`. NULL default. iov_bins allow override default IOV bins model. Specified vector timepoints specifying bin separators, e.g. `iov_bins = c(0, 24, 48, 72, 9999)`. seed set seed reproducible results sequence NULL specifies pseudo-random sequence use, e.g. \"halton\" \"sobol\". See `mvrnorm2` details. n_ind number individuals simulate event_table use previously created `design` object used ODE simulation instead calling create_event_table() create new one. Especially useful repeated calling sim(), optimizations optimal design analysis. Also see `sim_core()` even faster simulations using precalculated `design` objects. regimen regimen object created using regimen() function lagtime either value (numeric) parameter (character) NULL. covariates list covariates (single individual) created using `new_covariate()` function covariates_table data.frame (unnamed list named lists per individual) covariate values covariates_implementation used `covariates_table`, named list covariate implementation methods per covariate, e.g. `list(WT = \"interpolate\", BIN = \"locf\")` covariate_model R code used pre-calculate effective parameters use ADVAN-style analytical equations. used ODE simulations. A_init vector initial state ODE system only_obs return observations obs_step_size step size observations int_step_size step size numerical integrator t_max maximum simulation time, specified pick end regimen maximum t_obs vector observation times, output values (used t_obs==NULL) t_tte vector observation times time--event simulation t_init initialization time first dose, default 0. obs_type vector observation types. valid combination equal length vector `t_obs`. duplicate_t_obs allow duplicate t_obs output? E.g. optimal design calculations t_obs = c(0,1,2,2,3). Default FALSE. extra_t_obs include extra t_obs output bolus doses? activated `t_obs` specified manually. E.g. bolus dose t=24, FALSE, PKPDsim output trough, bolus doses might want switch setting TRUE. set \"auto\" (default), TRUE default, switch FALSE whenever `t_obs` specified manually. rtte repeated events allowed (FALSE default) checks perform input checks? Default TRUE. calculations sim_ode invoked many times (e.g. population estimation, optimal design) makes sense switch FALSE (confirming input correct) improve speed. verbose show output return_event_table return event table simulation , run actual simulation. Useful iterative use sim(). return_design returns design (event table several details) simulation, run actual simulation. Useful iterative functions like estimation combination `sim_core()`, e.g. estimation optimal design. output_include list specifying include output table, keys `parameters` `covariates`. FALSE default. ... extra parameters","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate ODE or analytical equation — sim","text":"data frame compartments associated concentrations requested times Simulated regimen","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/sim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simulate ODE or analytical equation — sim","text":"","code":"# \\donttest{ p <- list( CL = 38.48, V = 7.4, Q = 7.844, V2 = 5.19, Q2 = 9.324, V3 = 111 ) omega <- c(0.3, # IIV CL 0.1, 0.3) # IIV V r1 <- new_regimen( amt = 100, times = c(0, 24, 36), type = \"infusion\" ) mod <- new_ode_model(\"pk_3cmt_iv\") dat <- sim( ode = mod, parameters = p, omega = omega, n_ind = 20, regimen = r1 ) # }"},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_core.html","id":null,"dir":"Reference","previous_headings":"","what":"Only core function of the simulation function, always just returns observations.\nMostly useful for estimations / optimal design. Has no checks (for speed)! — sim_core","title":"Only core function of the simulation function, always just returns observations.\nMostly useful for estimations / optimal design. Has no checks (for speed)! — sim_core","text":"core function simulation function, always just returns observations. Mostly useful estimations / optimal design. checks (speed)!","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_core.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Only core function of the simulation function, always just returns observations.\nMostly useful for estimations / optimal design. Has no checks (for speed)! — sim_core","text":"","code":"sim_core(sim_object = NULL, ode, duplicate_t_obs = FALSE, t_init = 0)"},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_core.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Only core function of the simulation function, always just returns observations.\nMostly useful for estimations / optimal design. Has no checks (for speed)! — sim_core","text":"sim_object list design simulation parameters ode ode duplicate_t_obs allow duplicate t_obs output? E.g. optimal design calculations t_obs = c(0,1,2,2,3). Default FALSE. t_init time initization ODE system. Usually 0.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_core.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Only core function of the simulation function, always just returns observations.\nMostly useful for estimations / optimal design. Has no checks (for speed)! — sim_core","text":"Data frame simulation results","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecated function, renamed to sim() — sim_ode","title":"Deprecated function, renamed to sim() — sim_ode","text":"Deprecated function, renamed sim()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecated function, renamed to sim() — sim_ode","text":"","code":"sim_ode(...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecated function, renamed to sim() — sim_ode","text":"... parameters passed sim() function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deprecated function, renamed to sim() — sim_ode","text":"Output sim()","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode_shiny.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate ODE and create a Shiny app — sim_ode_shiny","title":"Simulate ODE and create a Shiny app — sim_ode_shiny","text":"function deprecated moved separate package https://github.com/ronkeizer/PKPDsimshiny.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode_shiny.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate ODE and create a Shiny app — sim_ode_shiny","text":"","code":"sim_ode_shiny(...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode_shiny.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate ODE and create a Shiny app — sim_ode_shiny","text":"... arguments passed PKPDsimShiny::sim_ode_shiny()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode_shiny.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate ODE and create a Shiny app — sim_ode_shiny","text":"return value","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/table_to_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a table to a list — table_to_list","title":"Convert a table to a list — table_to_list","text":"Convert table list","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/table_to_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a table to a list — table_to_list","text":"","code":"table_to_list(table)"},{"path":"https://insightrx.github.io/PKPDsim/reference/table_to_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a table to a list — table_to_list","text":"table data.frame","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/table_to_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert a table to a list — table_to_list","text":"List containing original table contents","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_model.html","id":null,"dir":"Reference","previous_headings":"","what":"Test a model — test_model","title":"Test a model — test_model","text":"Test model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test a model — test_model","text":"","code":"test_model(url, test_file, package, force = FALSE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/test_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Test a model — test_model","text":"url URL file path JSON representation model test_file Path .R file containing tests run package Package name force Run tests even model flagged building? Defaults FALSE","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_model.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Test a model — test_model","text":"Runs test file model return value","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_pointer.html","id":null,"dir":"Reference","previous_headings":"","what":"Test if model still in memory — test_pointer","title":"Test if model still in memory — test_pointer","text":"Test model still memory","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_pointer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test if model still in memory — test_pointer","text":"","code":"test_pointer(model)"},{"path":"https://insightrx.github.io/PKPDsim/reference/test_pointer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Test if model still in memory — test_pointer","text":"model pointer model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_pointer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Test if model still in memory — test_pointer","text":"return value","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/translate_ode.html","id":null,"dir":"Reference","previous_headings":"","what":"Translate a model from/to various PKPD simulators — translate_ode","title":"Translate a model from/to various PKPD simulators — translate_ode","text":"Currently supports PKDPsim <--> RxODE","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/translate_ode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Translate a model from/to various PKPD simulators — translate_ode","text":"","code":"translate_ode(code, auto = TRUE, from = NULL, to = NULL, verbose = TRUE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/translate_ode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Translate a model from/to various PKPD simulators — translate_ode","text":"code character string ODE code auto auto-detect syntax (``) syntax syntax verbose verbose, `TRUE` `FALSE`","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/translate_ode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Translate a model from/to various PKPD simulators — translate_ode","text":"Translated PKPDsim RxODE model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/triangle_to_full.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert triangle omega matrix to full omega matrix — triangle_to_full","title":"Convert triangle omega matrix to full omega matrix — triangle_to_full","text":"Convert triangle omega matrix full omega matrix","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/triangle_to_full.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert triangle omega matrix to full omega matrix — triangle_to_full","text":"","code":"triangle_to_full(vect)"},{"path":"https://insightrx.github.io/PKPDsim/reference/triangle_to_full.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert triangle omega matrix to full omega matrix — triangle_to_full","text":"vect vector specifying triangle omega matrix","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/triangle_to_full.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert triangle omega matrix to full omega matrix — triangle_to_full","text":"Omega matrix","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/vector_to_R_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Transform a vector into a string that evaluates to the same vector — vector_to_R_code","title":"Transform a vector into a string that evaluates to the same vector — vector_to_R_code","text":"Collapses vector comma-separated list strings quoted (special characters escaped). general purpose helper function writing new model code.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/vector_to_R_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transform a vector into a string that evaluates to the same vector — vector_to_R_code","text":"","code":"vector_to_R_code(vec)"},{"path":"https://insightrx.github.io/PKPDsim/reference/vector_to_R_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transform a vector into a string that evaluates to the same vector — vector_to_R_code","text":"vec vector","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/vector_to_R_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Transform a vector into a string that evaluates to the same vector — vector_to_R_code","text":"character string length 1","code":""},{"path":"https://insightrx.github.io/PKPDsim/news/index.html","id":"pkpdsim-111","dir":"Changelog","previous_headings":"","what":"PKPDsim 1.1.1","title":"PKPDsim 1.1.1","text":"CRAN release: 2022-04-01 first version PKPDsim released CRAN. PKPDsim development since 2014, previous versions made available Github (InsightRX/PKPDsim).","code":""}] +[{"path":"https://insightrx.github.io/PKPDsim/articles/PKPDsim.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"Getting started","text":"PKPDsim can installed CRAN: can install development version GitHub:","code":"install.packages(\"PKPDsim\") devtools::install_github(\"InsightRX/PKPDsim\")"},{"path":"https://insightrx.github.io/PKPDsim/articles/PKPDsim.html","id":"first-simulation","dir":"Articles","previous_headings":"","what":"First simulation","title":"Getting started","text":"main simulation function PKPDsim sim(). able simulate dosing regimen specific drug, least following three arguments required: ode: compiled ODE model (created using new_ode_model() function) parameters: list parameter values model regimen: dosing regimen (created using new_regimen() function) model library PKPDsim contains small library built-PK PD models, course interesting ability handle user-specified ODE systems. However, first example, let’s implement simple example library: probably noticed new_ode_model()-step took seconds finish, simulation order milliseconds. new_ode_model(), model compiled C++ source code binary code, takes seconds. However, done . compilation, model available used sim() long R session open. Let’s look output. PKPDsim output data “long” format, .e. one row per observed timepoint, split compartment: check output produced sim(), let’s plot (installation ggplot2 required).","code":"p <- list(CL = 1, V = 10, KA = 0.5) pk1 <- new_ode_model(\"pk_1cmt_oral\") r1 <- new_regimen( amt = 100, n = 5, interval = 12 ) dat <- sim( ode = pk1, parameters = p, regimen = r1 ) head(dat) ## id t comp y obs_type ## 1 1 0 1 100.00000 1 ## 4 1 1 1 60.65307 1 ## 40 1 2 1 36.78794 1 ## 76 1 3 1 22.31302 1 ## 112 1 4 1 13.53353 1 ## 148 1 5 1 8.20850 1 ggplot(dat, aes(x = t, y = y)) + geom_line() + facet_wrap(~ comp)"},{"path":"https://insightrx.github.io/PKPDsim/articles/PKPDsim.html","id":"custom-ode-model","dir":"Articles","previous_headings":"","what":"Custom ODE model","title":"Getting started","text":"can write exact model using custom ODE code. following example also output concentration (only_obs=TRUE), amounts compartment. ’re also going use infusion instead bolus injection:","code":"pk2 <- new_ode_model( code = \"dAdt[1] = -(CL/V) * A[1]\", obs = list(cmt = 1, scale = \"V\"), dose = list(cmt = 1) ) r2 <- new_regimen( amt = 100, n = 5, interval = 12, type = \"infusion\", t_inf = 2 ) dat2 <- sim( ode = pk2, parameters = p, regimen = r2, only_obs = TRUE ) ggplot(dat2, aes(x = t, y = y)) + geom_line()"},{"path":"https://insightrx.github.io/PKPDsim/articles/PKPDsim.html","id":"included-models","dir":"Articles","previous_headings":"","what":"Included models","title":"Getting started","text":"PKPDsim includes definitions several PK/PD models used InsightRX platform. models can installed R packages using model_from_api() function. Please note models may differ used production InsightRX. provided demonstration purposes , used dosing patients.","code":"model_from_api( system.file(\"models\", \"pk_vanco_anderson.json5\", package = \"PKPDsim\"), to_package = TRUE, install_all = TRUE )"},{"path":"https://insightrx.github.io/PKPDsim/articles/PKPDsim.html","id":"example-usage","dir":"Articles","previous_headings":"Included models","what":"Example usage","title":"Getting started","text":"simulate PK, provide model parameters PKPDsim::sim() along dosing regimen covariates.","code":"## Create dosing regimen and covariates reg <- new_regimen( amt = 100, n = 3, interval = 12, type = \"infusion\", t_inf = 1 ) covs <- list( WT = new_covariate(4), PMA = new_covariate(42), CR = new_covariate(0.5), CL_HEMO = new_covariate(0) ) ## Perform simulation sim( ode = pkvancoanderson::model(), parameters = pkvancoanderson::parameters(), regimen = reg, covariates = covs )"},{"path":"https://insightrx.github.io/PKPDsim/articles/covariates.html","id":"covariates","dir":"Articles","previous_headings":"","what":"Covariates","title":"Covariates","text":"Covariates implemented using new_covariate() function, wrapped named list. example: names covariate list-object correspond exactly names covariates model.","code":"covariates <- list( \"WT\" = new_covariate(value = 70), \"SCR\" = new_covariate(value = 120) )"},{"path":"https://insightrx.github.io/PKPDsim/articles/covariates.html","id":"time-varying-covariates","dir":"Articles","previous_headings":"Covariates","what":"Time-varying covariates","title":"Covariates","text":"Time-varing covariates, creatinine values can implemented easily well. just require additional times argument: default, PKPDsim assumes want interpolate (linearly) measurements time-varying covariates. prefer implement covariate using last-observation-carried-forward (words step function), specify method = \"LOCF\" argument new_covariate().","code":"covariates <- list( \"WT\" = new_covariate(value = 70), \"CR\" = new_covariate( value = c(0.8, 1, 1.2), times = c(0, 48, 72) ) )"},{"path":"https://insightrx.github.io/PKPDsim/articles/covariates.html","id":"covariates-for-multiple-patients","dir":"Articles","previous_headings":"Covariates","what":"Covariates for multiple patients","title":"Covariates","text":"table covariates can supplied sim() covariate values per individual. can handle static time-varying covariates. covariate table look like : id t (time) columns can omitted static covariates used. , make sure headers used covariates match exactly covariate names specified model definition. full example model (simulated) covariates patient population: Note: PKPDsim handle missing covariate values. missing covariate data, probably best approach impute values manually simulation, e.g. based mean observed / known value, correlation covariates.","code":"cov_table <- data.frame( id = c(1, 1, 2, 3), WT = c(40, 45, 50, 60), SCR = c(50, 150, 90, 110), t = c(0, 5, 0, 0) ) parameters <- list( CL = 1, V = 10, KA = 0.5 ) n_ind <- 50 cov_table <- data.frame( 'id' = 1:n_ind, 'WT' = rnorm(n_ind, mean = 70, sd = 5) ) model <- new_ode_model( code = ' CLi = CL * pow((WT/70), 0.75) Vi = V * (WT/70) dAdt[1] = -KA*A[1] dAdt[2] = KA*A[1] -(CLi/Vi)*A[2] ', declare_variables = c('CLi', 'Vi'), covariates = c('WT'), dose = list(cmt = 1), obs = list(cmt = 2, scale = 'V * (WT/70)') ) regimen <- new_regimen( amt = 30, n = 4, type = 'bolus', interval = 12 ) dat <- sim( ode = model, parameters = parameters, t_obs = c(0.5, 2, 4, 8, 12, 16, 24), n_ind = n_ind, regimen = regimen, covariates_table = cov_table, output_include = list(covariates = TRUE) ) ## Simulating 50 individuals."},{"path":"https://insightrx.github.io/PKPDsim/articles/error.html","id":"residual-error","dir":"Articles","previous_headings":"","what":"Residual error","title":"Residual error","text":"PKPDsim can simulate residual errors observed data, can done res_var argument sim() function. argument requires list() one following components: prop: proportional error: \\[y = \\hat{y} \\cdot (1 + \\mathcal{N}(0, prop))\\] add: additive error: \\[y = \\hat{y} + \\mathcal{N}(0, add))\\] exp: exponential error: \\[y = \\hat{y} \\cdot e^{\\mathcal{N}(0, exp)}\\] list elements can combined, e.g. combined proportional additive error model one write e.g.: res_var = list(prop = 0.1, add = 1), give 10% proportional error plus additive error 1 concentration unit. examples res_var argument Combined proportional additive: Exponential: Besides including residual error simulation time, also option include afterwards. , function add_ruv() useful.","code":"mod <- new_ode_model(\"pk_1cmt_iv\") reg <- new_regimen( amt = 1000, n = 5, interval = 12, type = \"bolus\" ) sim1 <- sim( mod, parameters = list(CL = 5, V = 150), res_var = list(prop = 0.1, add = 1), regimen = reg, only_obs=TRUE ) ggplot(sim1, aes(x = t, y = y)) + geom_point() sim2 <- sim( mod, parameters = list(CL = 5, V = 150), res_var = list(exp = 0.1), regimen = reg, only_obs=TRUE ) sim3 <- sim1 sim3$y <- add_ruv( x = sim3$y, ruv = list( prop = 0.1, add = 1 ) ) ggplot(sim3, aes(x = t, y = y)) + geom_point()"},{"path":"https://insightrx.github.io/PKPDsim/articles/estimation-nlmixr.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Estimation: nlmixr2","text":"PKPDsim R package include functionality perform population estimation within package, offer convenient translator able use nlmixr2 R package parameter estimation. nlmixr2 allows fitting population PK-PD models using common algorithms applied pharmacometrics, FOCE SAEM. installation usage nlmixr2, please refer documentation nlmixr2 package respective website.","code":""},{"path":"https://insightrx.github.io/PKPDsim/articles/estimation-nlmixr.html","id":"translation","dir":"Articles","previous_headings":"","what":"Translation","title":"Estimation: nlmixr2","text":"hood, nlmixr2 uses rxode2 R package perform PKPD model simulations, similar PKPDsim. model syntax rxode2 nlmixr2 compared PKPDsim also similar, making translation fairly straightforward. model translator function therefore included PKPDsim allows translation PKPDsim model nlmixr2 syntax: returned object f generated pkpdsim_to_nlmixr() object defines required model parameter definitions nlmixr syntax: full code example included . Note: nlmixr nlmixr-translator PKPDsim still active development. Syntax results may therefore change.","code":"mod <- new_ode_model(\"pk_1cmt_iv\") f <- pkpdsim_to_nlmixr( model = mod, parameters = list(CL = 5, V = 50), omega = c(0.1, 0.05, 0.1), res_var = list(prop = 0.1, add = 0.1), log_transform = TRUE ) f ## function () ## { ## ini({ ## logCL <- log(5) ## logV <- log(50) ## err_prop <- c(0, 0.1, 1) ## err_add <- c(0, 1, 10) ## eta_CL + eta_V ~ c(0.1, 0.05, 0.1) ## }) ## model({ ## CL <- exp(logCL + eta_CL) ## V <- exp(logV + eta_V) ## d/dt(A1) = -(CL/V) * A1 ## y = A1/V ## y ~ prop(err_prop) + add(err_add) ## }) ## } ## "},{"path":"https://insightrx.github.io/PKPDsim/articles/estimation-nlmixr.html","id":"example","dir":"Articles","previous_headings":"","what":"Example","title":"Estimation: nlmixr2","text":"","code":"library(tidyverse) library(nlmixr2) ## Define parameters par <- list(CL = 5, V = 50) ruv <- list(prop = 0.1, add = 1) omega <- c(0.1, 0.05, 0.1) ## Simulate data t_obs <- c(8, 23.5, 25, 71.5) n <- 50 regimen <- new_regimen( amt = 1500, n = 4, interval = 24 ) conc <- sim( ode = mod, regimen = regimen, parameters = par, omega = omega, only_obs = T, t_obs = t_obs, n = n, res_var = ruv ) %>% mutate(EVID = 0, AMT = 0, MDV = 0, CMT = 1) %>% select(ID = id, TIME = t, CMT, DV = y, AMT, EVID, MDV) doses <- regimen_to_nm( regimen, n_ind = n ) ## Combine observed data and dose data simdat <- bind_rows(doses, conc) %>% dplyr::arrange(ID, TIME) ## Create nlmixr model object f <- pkpdsim_to_nlmixr( model = mod, parameters = par, omega = c(0.1, 0.05, 0.1), res_var = list(prop = 0.1, add = 0.1), log_transform = T ) ## Perform fit using nlmixr (SAEM) fit <- nlmixr( object = f, data = simdat, est = \"saem\" ) fit ## ── nlmixr² SAEM OBJF by FOCEi approximation ── ## ## Gaussian/Laplacian Likelihoods: AIC(fit) or fit$objf etc. ## FOCEi CWRES & Likelihoods: addCwres(fit) ## ## ── Time (sec fit$time): ── ## ## setup covariance saem table compress other ## elapsed 0.002033 0.017005 9.944 0.089 0.023 1.418962 ## ## ── Population Parameters (fit$parFixed or fit$parFixedDf): ── ## ## Est. SE %RSE Back-transformed(95%CI) BSV(CV%) Shrink(SD)% ## logCL 1.64 0.0493 3.01 5.15 (4.67, 5.67) 27.4 19.8% ## logV 3.86 0.0483 1.25 47.5 (43.2, 52.2) 13.4 28.9% ## err_prop 0.258 0.258 ## err_add 1.41 1.41 ## ## Covariance Type (fit$covMethod): linFim ## Correlations in between subject variability (BSV) matrix: ## cor:eta_V,eta_CL ## 0.886 ## ## ## Full BSV covariance (fit$omega) or correlation (fit$omegaR; diagonals=SDs) ## Distribution stats (mean/skewness/kurtosis/p-value) available in fit$shrink ## Censoring (fit$censInformation): No censoring ## ## ── Fit Data (object fit is a modified tibble): ── ## # A tibble: 200 × 16 ## ID TIME DV PRED RES IPRED IRES IWRES eta_CL eta_V y A1 ## ## 1 1 8 17.6 13.3 4.31 19.5 -1.89 -0.362 -0.449 -0.177 19.5 776. ## 2 1 23.5 7.00 2.48 4.52 5.42 1.57 0.792 -0.449 -0.177 5.42 216. ## 3 1 25 46.2 30.4 15.8 39.5 6.74 0.655 -0.449 -0.177 39.5 1572. ## # ℹ 197 more rows ## # ℹ 4 more variables: CL , V , tad , dosenum "},{"path":"https://insightrx.github.io/PKPDsim/articles/example-absorption-models.html","id":"absorption-with-lag-time","dir":"Articles","previous_headings":"","what":"Absorption with lag time","title":"Absorption models","text":"Specify lagtime create model using new_ode_model. lag time can either number, string referring parameter (e.g. “ALAG”). single number parameter specified, lag time apply default dose compartment . Alternatively, also possible specify vector lag times, value compartment.","code":"library(\"PKPDsim\") pk <- new_ode_model( code = \" dAdt[1] = -KA * A[1]; dAdt[2] = KA*A[1] -(CL/V) * A[2] \", obs = list(cmt = 2, scale=\"V\"), dose = list(cmt = 1), lagtime = \"ALAG\" ) r <- new_regimen( amt = c(100, 100, 100), times = c(0, 12, 24), cmt = 1 ) p <- list(CL = 5, V = 10, KA = 0.25, ALAG = 2) res <- sim( ode = pk, n_ind = 25, omega = cv_to_omega( par_cv = list(\"CL\" = 0.1, \"V\" = 0.1, \"KA\" = .1, \"ALAG\" = 0.3), p ), parameters = p, regimen = r, verbose = FALSE, only_obs = TRUE )"},{"path":"https://insightrx.github.io/PKPDsim/articles/example-absorption-models.html","id":"absorption-transit-compartments","dir":"Articles","previous_headings":"","what":"Absorption transit compartments","title":"Absorption models","text":"code implements transit compartment model absorption compartments described Savic et al. JPKPD 2007. Please note implementation assumes drug amount absorbed within dosing interval. assumption might always hold. Also, implementation dosing, essential set bioavailability dose compartment 0, since dosing now implemented using separate analytical equation. Note: simplified way coding transit compartments model added soon PKPDsim.","code":"library(PKPDsim) parameters <- list(CL = 15, V = 50, MTT = 2.5, N = 4, KA = 1) reg1 <- new_regimen(amt = 100, n = 3, interval = 12) # needs dummy doses mod <- new_ode_model( code = \" tad = t - t_prv_dose KTR = (N+1)/MTT LNFAC= log(2.506628)+(N+0.5)*log(N)-N dAdt[1] = exp(log(prv_dose) + log(KTR) + N*log(KTR * tad) - KTR * tad - LNFAC) - KA*A[1] dAdt[2] = KA*A[1]-CL/V*A[2] \", declare_variables = c(\"LNFAC\", \"KTR\", \"tad\"), parameters = parameters, dose = list(cmt = 1, bioav = 0), obs = list(cmt = 2, scale = \"V\") ) res <- sim( ode = mod, regimen = reg1, parameters = parameters, n = 5, omega = cv_to_omega( list(CL = 0.1, V = 0.1, MTT = 0.2, N =0.1, KA=0.1), parameters ), t_obs = seq(0, 36, .5) )"},{"path":"https://insightrx.github.io/PKPDsim/articles/example-pkpd-model.html","id":"combine-pk-and-pd-models","dir":"Articles","previous_headings":"","what":"Combine PK and PD models","title":"PKPD model","text":"shown , PK-PD model can written single set differential equations. However, often develop PK PD models separately e.g. want plug various PK models existing PD models. PKPDsim can two model parts separately list code argument: two systems ODEs combined single one.","code":"pkpd <- new_ode_model( code = list( pk = \"dAdt[1] = -(CL/V) * A[1]; conc = A[1]/V; \", pd = \" dAdt[1] = KIN * 1/(1+EFF*conc) - KOUT*A[1]; \" ), state_init = list(pd = \"A[1] = KIN/KOUT;\") )"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Model","text":"new_ode_model function creates new ODE model can used sim() command. defines ODE system sets attributes model. model can specified three different ways: model: string references model library included PKPDsim. Examples current library e.g. pk_1cmt_oral, pk_2cmt_iv. show available models, run new_ode_model() without arguments. code: using code specifying derivatives ODE specified pseudo-R code file: similar code, reads code file","code":""},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"model-from-library","dir":"Articles","previous_headings":"","what":"Model from library","title":"Model","text":"example, 1-compartment oral PK model can obtained using: Run new_ode_model() function without arguments see currently available models:","code":"pk1 <- new_ode_model(model = \"pk_1cmt_oral\") new_ode_model() ## Error in new_ode_model(): Either a model name (from the PKPDsim library), ODE code, an R function, or a file containing code for the ODE system have to be supplied to this function. The following models are available: ## pk_1cmt_iv ## pk_1cmt_iv_auc ## pk_1cmt_iv_mm ## pk_2cmt_iv ## pk_2cmt_iv_auc ## pk_3cmt_iv ## pk_1cmt_oral ## pk_2cmt_oral ## pk_3cmt_oral"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"custom-model-from-code","dir":"Articles","previous_headings":"","what":"Custom model from code","title":"Model","text":"custom model needs specified string text block: input code adhere follow rules: derivaties ODE system defined using dAdt array indices derivatives compartments indicated [ ]. Compartments indices can start either 0 1. latter, indices reduced 1 translation C++ code. equations defined using = power functions need written pow(base,exp). force numbers interpreted real, avoid interpreted integer. equation involves real number 3, usually safer write 3.0 code. input code translated C++ function. can check model compiled correctly typing model name R command line, prints model information: ’re interested, can also output actual C++ function compiled specifying cpp_show_code=TRUE argument new_ode_model() function.","code":"pk1 <- new_ode_model(code = \" dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL/V) * A[2] \") pk1 ## ODE definition: ## ## dAdt[1] = -KA * A[1]; ## dAdt[2] = +KA * A[1] -(CL/V) * A[2]; ## ; ## ## Required parameters: KA, CL, V ## Covariates: ## Variables: ## Fixed parameters: ## Number of compartments: 2 ## Observation variable: ## Observation scaling: 1 ## Lag time: none ## IOV CV: {} ## IOV bins: 1 ## Comments: ## -"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"more-custom-model-options","dir":"Articles","previous_headings":"","what":"More custom model options","title":"Model","text":"can introduce new variables code, define using declare_variables argument : Also, want use covariates ODE system (info define covariates Covariates vignette), define , code function call: One exception input code syntax definition power functions. PKPDsim translate pseudo-R code valid C++ syntax automatically. C/C++ use ^ indicate power functions, uses pow(value, base) function instead, example allometric PK model written :","code":"pk1 <- new_ode_model(code = \" KEL = CL/V dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -KEL * A[2] \", declare_variables = c(\"KEL\")) pk1 <- new_ode_model(code = \" CLi = WT/70 KEL = CLi/V dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL*(WT/70)/V) * A[2] \", declare_variables = c(\"KEL\", \"CLi\"), covariates = c(\"WT\")) pk1 <- new_ode_model(code = \" CLi = CL * pow((WT/70), 0.75) dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CLi/V) * A[2] \", declare_variables = c(\"CLi\"))"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"dosing-bioavailability","dir":"Articles","previous_headings":"More custom model options","what":"Dosing / bioavailability","title":"Model","text":"default dosing compartment bioavailability can specified using dose argument. default, dose go compartment 1, bioavailability 1. bioav element list can either number character string referring parameter. Bioavailability can also used dosing based mg/kg, since supported new_regimen(). way implement scaling dose “weight” covariate using bioavailability:","code":"pk1 <- new_ode_model(code = \" dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL/V) * A[2] \", dose = list(cmt = 1, bioav = \"F1\"), parameters = list(KA = 1, CL = 5, V = 50, F1 = 0.7) ) mod <- new_ode_model(code = \" dAdt[1] = -(CL/V)*A[1]; \", dose = list(cmt = 1, bioav = \"WT\"), obs = list(cmt = 1, scale = \"V\"), covariates = list(\"WT\" = new_covariate(value = 70)) )"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"observations","dir":"Articles","previous_headings":"More custom model options","what":"Observations","title":"Model","text":"observation compartment can set specifying list obs argument, either elements cmt scale, variable. scale can either parameter number, cmt can number. Note variables specified inside differential equation block available scaling parameters. E.g. allometry redefine scaled volume follows: define observation using variable:","code":"pk1 <- new_ode_model(code = \" dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL/V) * A[2] \", obs = list(cmt = 2, scale = \"V\") ) pk1 <- new_ode_model(code = \" Vi = V * (WT/70) dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL/Vi) * A[2] \", obs = list(cmt = 2, scale = \"V * (WT/70)\") ) pk1 <- new_ode_model(code = \" dAdt[1] = -KA * A[1] dAdt[2] = +KA * A[1] -(CL/V) * A[2] CONC = A[2] \", obs = list(variable = \"CONC\"), declare_variables = \"CONC\" )"},{"path":"https://insightrx.github.io/PKPDsim/articles/model.html","id":"custom-model-from-file","dir":"Articles","previous_headings":"","what":"Custom model from file","title":"Model","text":"Using file= argument, model code read specified files. just convenience function, .e. allows separate models R code easily.","code":"pk1 <- new_ode_model( file = \"pk_1cmt_oral_nonlin_v1.txt\", declare_variables = c(\"KEL\", \"CLi\") )"},{"path":"https://insightrx.github.io/PKPDsim/articles/output.html","id":"multiple-observation-types","dir":"Articles","previous_headings":"","what":"Multiple observation types","title":"Output","text":"like output one observation type, concentration parent drug concentration metabolite, can control using obs argument. example amount absorption compartment well systemic drug concentration outputted.","code":"mod <- new_ode_model(code = \" dAdt[1] = -KA * A[1]; dAdt[2] = -(CL/V) * A[2] + KA*A[1]; \", obs = list( cmt = c(2, 2), scale = c(1, \"V\"), label = c(\"abs\", \"conc\") ) ) par <- list(CL = 5, V = 50, KA = .5) reg <- new_regimen(amt = 100, n = 5, interval = 12) res <- sim( ode = mod, parameters = par, regimen = reg, only_obs = T )"},{"path":"https://insightrx.github.io/PKPDsim/articles/output.html","id":"parameters-variables-and-covariates","dir":"Articles","previous_headings":"","what":"Parameters, variables, and covariates","title":"Output","text":"often useful include model parameters, generated variables, /covariates output table well, especially covariates -subject variability included simulation, debugging models. can use output_include argument :","code":"mod_1cmt_iv <- new_ode_model(\"pk_1cmt_iv\") p <- list(CL = 5, V = 50) reg <- new_regimen (amt = 100, n = 4, interval = 12, type = \"bolus\", cmt=1) cov_table <- data.frame( id = c(1, 1, 2, 3), WT = c(40, 45, 50, 60), SCR = c(50, 150, 90,110), t = c(0, 5, 0, 0) ) dat <- sim( ode = mod_1cmt_iv, parameters = p, regimen = reg, covariates_table = cov_table, covariates_implementation = list(SCR = \"interpolate\"), n_ind = 3, only_obs = T, output_include = list(parameters = TRUE, covariates=TRUE) ) ## Simulating 3 individuals. head(dat) ## id t comp y obs_type CL V WT SCR ## 1 1 0 obs 2.000000 1 5 50 40 50 ## 4 1 1 obs 1.809675 1 5 50 41 70 ## 40 1 2 obs 1.637462 1 5 50 42 90 ## 76 1 3 obs 1.481636 1 5 50 43 110 ## 112 1 4 obs 1.340640 1 5 50 44 130 ## 142 1 5 obs 1.213061 1 5 50 45 150"},{"path":"https://insightrx.github.io/PKPDsim/articles/regimen.html","id":"steady-state","dir":"Articles","previous_headings":"","what":"Steady state","title":"Regimen","text":"Instead simulating full concentration time course give model, want simulate PK(PD) steady state, can also specify ss=TRUE argument new_regimen(), simulate regimen steady state. default, steady state assumed occur 5 days (PKPDsim doesn’t check steady state reached!), want decrease increase can specifying n_ss argument takes number doses simulate assuming steady state.","code":"reg_ss <- new_regimen( amt = 100, interval = 12, n = 5, ss = TRUE, n_ss = 10 ) reg_ss ## Note: Steady state regimen, steady state assumed to be reached at t = 0. ## t type amt t_inf ## 1 0 bolus 100 0 ## 2 12 bolus 100 0 ## 3 24 bolus 100 0 ## 4 36 bolus 100 0 ## 5 48 bolus 100 0"},{"path":"https://insightrx.github.io/PKPDsim/articles/speed.html","id":"comparison-with-other-packages","dir":"Articles","previous_headings":"","what":"Comparison with other packages","title":"Speed","text":"Several open source R packages provide similar features PKPDsim, main ones RxODE (now renamed rxode2) mrgsolve. rxode2 package, overhead pre- post-processing separated main simulation function default, mrgsolve similar PKPDsim overhead included within main simulation function. Therefore, especially used iterative context, RxODE seem much faster PKDPsim mrgsolve, PKPDsim mrgsolve seem broadly similar. However, using sim_core() function outlined , benchmarks indicate simulation speed PKDDsim highly similar obtained RxODE package.","code":""},{"path":"https://insightrx.github.io/PKPDsim/articles/variability.html","id":"variability-distribution","dir":"Articles","previous_headings":"","what":"Variability distribution","title":"Variability","text":"default, PKPDsim assume exponential distribution parameters omega specified. normal distribution desired parameters, please use omega_type argument:","code":"dat <- sim( ode = model, parameters = parameters, regimen = regimen, n = 50, omega = c( 0.2, 0.05, 0.1 ), omega_type = c(\"normal\", \"normal\") )"},{"path":"https://insightrx.github.io/PKPDsim/articles/variability.html","id":"more-flexible-variability-models","dir":"Articles","previous_headings":"","what":"More flexible variability models","title":"Variability","text":"allow flexibility -subject variability enters model, alternative way specifying variability. approach similar way variability encoded NONMEM, .e. variability components (eta’s) added explicitly model code. PKPDsim means eta’s treated just like regular parameters, 0 mean normal distribution. See example simulation bioavailability using logit-distribution.","code":"mod1 <- new_ode_model( code = \" CLi = CL * exp(eta1) Vi = V * exp(eta2) F1i = exp(F1 + eta3) / (1 + exp(F1 + eta3)) dAdt[1] = -KA * A[1] dAdt[2] = KA * A[1] - (CLi/Vi) * A[2] \", declare_variables = c(\"CLi\", \"Vi\", \"F1i\"), obs = list(cmt = 2, scale = \"V * exp(eta2)\"), dose = list(cmt = 1, bioav = \"F1i\") ) reg1 <- new_regimen(amt = 100, n = 2, interval = 12, type=\"oral\") dat <- sim( ode = mod1, regimen = reg1, parameters = list( eta1 = 0, eta2 = 0, eta3 = 0, CL = 5, V = 50, KA = .5, F1 = 0.8 ), t_obs = c(0:48), omega = c( 0.1, 0.05, 0.1, 0, 0, 0.1 ), n = 100, omega_type = c(\"normal\", \"normal\", \"normal\"), output_include = list(\"parameters\" = TRUE, variables = TRUE), only_obs = TRUE ) library(ggplot2) ggplot(dat, aes(x = t, y = y, group = id)) + geom_line() ggplot(dat, aes(x = F1i)) + geom_histogram() ## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`."},{"path":"https://insightrx.github.io/PKPDsim/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Ron Keizer. Author, maintainer. Jasmine Hughes. Author. Dominic Tong. Author. Kara Woo. Author. InsightRX. Copyright holder, funder.","code":""},{"path":"https://insightrx.github.io/PKPDsim/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Keizer R, Hughes J, Tong D, Woo K (2024). PKPDsim: Tools Performing Pharmacokinetic-Pharmacodynamic Simulations. R package version 1.3.0, https://insightrx.github.io/PKPDsim/, https://github.com/InsightRX/PKPDsim.","code":"@Manual{, title = {PKPDsim: Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations}, author = {Ron Keizer and Jasmine Hughes and Dominic Tong and Kara Woo}, year = {2024}, note = {R package version 1.3.0, https://insightrx.github.io/PKPDsim/}, url = {https://github.com/InsightRX/PKPDsim}, }"},{"path":"https://insightrx.github.io/PKPDsim/index.html","id":"pkpdsim-","dir":"","previous_headings":"","what":"Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations","title":"Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations","text":"PKPDsim library numerical integration ODE systems, particular pharmacokinetic-pharmacodynamic (PK-PD) mixed-effects models.","code":""},{"path":"https://insightrx.github.io/PKPDsim/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations","text":"development version PKPDsim always --date improvements bug fixes. aim release PKPDsim CRAN least year, depending number impact updates made development version. CRAN version PKPDsim can installed using: development version PKPDsim can installed using:","code":"install.packages(\"PKPDsim\") devtools::install_github(\"InsightRX/PKPDsim\")"},{"path":"https://insightrx.github.io/PKPDsim/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations","text":"welcome input community: think encountered bug, please submit issue GitHub page. Please include reproducible example unexpected behavior. Please open pull request fix updates improve package. ’re sure proposed changes useful within scope package, feel free contact one authors package.","code":""},{"path":"https://insightrx.github.io/PKPDsim/index.html","id":"disclaimer","dir":"","previous_headings":"","what":"Disclaimer","title":"Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations","text":"functionality R package provided “”. authors adhere software development best practices, software may still contain unintended errors. InsightRX Inc. authors package can held liable damages resulting use software. use software package, user waives warranties, expressed implied, including warranties accuracy, quality suitability InsightRX particular purpose, either medical non-medical. ©","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":null,"dir":"Reference","previous_headings":"","what":"ADVAN-style equations — OneCompIVbolus","title":"ADVAN-style equations — OneCompIVbolus","text":"Adapted Abuhelwa et al. JPET 2015","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ADVAN-style equations — OneCompIVbolus","text":"","code":"OneCompIVbolus(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ADVAN-style equations — OneCompIVbolus","text":"d data, NONMEM style data frame 1 subject columns TIME, AMT, MDV, DV, CL, V","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ADVAN-style equations — OneCompIVbolus","text":"Returns dataframe populated columns A1, DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ADVAN-style equations — OneCompIVbolus","text":"Functions calculating drug amount compartments common pharmacokinetic models (1,2,3 compartment IV bolus, IV infusion, first-order absorption models) Definitions: - *last: initial amount beginning time interval (t, t=t2-t1) corresponding compartment (.e. drug amount end last time interval) - E* : sum Exit (elimination) rate constant corresponding compartment. IV bolus- 1 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVbolus.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"ADVAN-style equations — OneCompIVbolus","text":"Abuhelwa, . Y., Foster, D. J. R., Upton, R. N. (2015) ADVAN-style analytical solutions common pharmacokinetic models. J Pharmacol Toxicol Methods 73:42-8. DOI: 10.1016/j.vascn.2015.03.004","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVinfusion.html","id":null,"dir":"Reference","previous_headings":"","what":"IV infusion- 1 compartment — OneCompIVinfusion","title":"IV infusion- 1 compartment — OneCompIVinfusion","text":"IV infusion- 1 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVinfusion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"IV infusion- 1 compartment — OneCompIVinfusion","text":"","code":"OneCompIVinfusion(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVinfusion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"IV infusion- 1 compartment — OneCompIVinfusion","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV, RATE, RATEALL, DV, CL, V","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompIVinfusion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"IV infusion- 1 compartment — OneCompIVinfusion","text":"Returns dataframe populated columns A1, DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompOral.html","id":null,"dir":"Reference","previous_headings":"","what":"first-order absorption 1 compartment — OneCompOral","title":"first-order absorption 1 compartment — OneCompOral","text":"first-order absorption 1 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompOral.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"first-order absorption 1 compartment — OneCompOral","text":"","code":"OneCompOral(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompOral.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"first-order absorption 1 compartment — OneCompOral","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,DV, CL, V, KA & F1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/OneCompOral.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"first-order absorption 1 compartment — OneCompOral","text":"Returns dataframe populated columns A1, A2 DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/PKPDsim-package.html","id":null,"dir":"Reference","previous_headings":"","what":"PKPDsim package — PKPDsim-package","title":"PKPDsim package — PKPDsim-package","text":"Simulate regimens PKPD models defined ODE systems","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/PKPDsim-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"PKPDsim package — PKPDsim-package","text":"Ron Keizer ronkeizer@gmail.com","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVbolus.html","id":null,"dir":"Reference","previous_headings":"","what":"IV bolus- 3 compartment — ThreeCompIVbolus","title":"IV bolus- 3 compartment — ThreeCompIVbolus","text":"IV bolus- 3 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVbolus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"IV bolus- 3 compartment — ThreeCompIVbolus","text":"","code":"ThreeCompIVbolus(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVbolus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"IV bolus- 3 compartment — ThreeCompIVbolus","text":"d data, Accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,DV, CL, V1, Q12, V2, Q13, V3","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVbolus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"IV bolus- 3 compartment — ThreeCompIVbolus","text":"Returns dataframe populated columns A1, A2, A3,DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusion.html","id":null,"dir":"Reference","previous_headings":"","what":"IV infusion- 3 compartment — ThreeCompIVinfusion","title":"IV infusion- 3 compartment — ThreeCompIVinfusion","text":"IV infusion- 3 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"IV infusion- 3 compartment — ThreeCompIVinfusion","text":"","code":"ThreeCompIVinfusion(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"IV infusion- 3 compartment — ThreeCompIVinfusion","text":"d data, Accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,RATE, RATEALL, DV, CL, V1, Q12, V2, Q13, V3","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"IV infusion- 3 compartment — ThreeCompIVinfusion","text":"Returns dataframe populated columns A1, A2, A3,DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusionMetab.html","id":null,"dir":"Reference","previous_headings":"","what":"3-compartment IV infusion with first-order metabolite formation — ThreeCompIVinfusionMetab","title":"3-compartment IV infusion with first-order metabolite formation — ThreeCompIVinfusionMetab","text":"3-compartment IV infusion first-order metabolite formation","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusionMetab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"3-compartment IV infusion with first-order metabolite formation — ThreeCompIVinfusionMetab","text":"","code":"ThreeCompIVinfusionMetab(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusionMetab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"3-compartment IV infusion with first-order metabolite formation — ThreeCompIVinfusionMetab","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,RATE, RATEALL, DV, CL, V1, Q12, V2, Q13, V3, CLM,VM,km","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompIVinfusionMetab.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"3-compartment IV infusion with first-order metabolite formation — ThreeCompIVinfusionMetab","text":"Returns dataframe populated columns A1, A2, A3,DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOral.html","id":null,"dir":"Reference","previous_headings":"","what":"first-order absorption- 3 compartment — ThreeCompOral","title":"first-order absorption- 3 compartment — ThreeCompOral","text":"first-order absorption- 3 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOral.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"first-order absorption- 3 compartment — ThreeCompOral","text":"","code":"ThreeCompOral(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOral.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"first-order absorption- 3 compartment — ThreeCompOral","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,DV, CL, V2, Q3, V3, Q4, V4, KA & F1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOral.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"first-order absorption- 3 compartment — ThreeCompOral","text":"Returns dataframe populated columns A1, A2, A3, A4 DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOralMetab.html","id":null,"dir":"Reference","previous_headings":"","what":"first-order absorption- 3 compartment-Metabolite — ThreeCompOralMetab","title":"first-order absorption- 3 compartment-Metabolite — ThreeCompOralMetab","text":"first-order absorption- 3 compartment-Metabolite","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOralMetab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"first-order absorption- 3 compartment-Metabolite — ThreeCompOralMetab","text":"","code":"ThreeCompOralMetab(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOralMetab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"first-order absorption- 3 compartment-Metabolite — ThreeCompOralMetab","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,DV, CL, V2, Q3, V3, Q4, V4, KA & F1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ThreeCompOralMetab.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"first-order absorption- 3 compartment-Metabolite — ThreeCompOralMetab","text":"Returns dataframe populated columns A1, A2, A3, A4 DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVbolus.html","id":null,"dir":"Reference","previous_headings":"","what":"IV bolus- 2 compartment — TwoCompIVbolus","title":"IV bolus- 2 compartment — TwoCompIVbolus","text":"IV bolus- 2 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVbolus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"IV bolus- 2 compartment — TwoCompIVbolus","text":"","code":"TwoCompIVbolus(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVbolus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"IV bolus- 2 compartment — TwoCompIVbolus","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV, DV, CL, V1, Q, V2","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVbolus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"IV bolus- 2 compartment — TwoCompIVbolus","text":"Returns dataframe populated columns A1, A2, DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVinfusion.html","id":null,"dir":"Reference","previous_headings":"","what":"IV infusion- 2 compartment — TwoCompIVinfusion","title":"IV infusion- 2 compartment — TwoCompIVinfusion","text":"IV infusion- 2 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVinfusion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"IV infusion- 2 compartment — TwoCompIVinfusion","text":"","code":"TwoCompIVinfusion(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVinfusion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"IV infusion- 2 compartment — TwoCompIVinfusion","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV, RATE, RATEALL, DV, CL, V1, Q, V2","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompIVinfusion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"IV infusion- 2 compartment — TwoCompIVinfusion","text":"Returns dataframe populated columns A1, A2, DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompOral.html","id":null,"dir":"Reference","previous_headings":"","what":"First-order absorption- 2 compartment — TwoCompOral","title":"First-order absorption- 2 compartment — TwoCompOral","text":"First-order absorption- 2 compartment","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompOral.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"First-order absorption- 2 compartment — TwoCompOral","text":"","code":"TwoCompOral(d)"},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompOral.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"First-order absorption- 2 compartment — TwoCompOral","text":"d data, accepts NONMEM style data frame 1 subject columns TIME, AMT,MDV,DV, CL, V2, Q, V3, KA & F1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/TwoCompOral.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"First-order absorption- 2 compartment — TwoCompOral","text":"Returns dataframe populated columns A1, A2, A3 DV","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_quotes.html","id":null,"dir":"Reference","previous_headings":"","what":"Put vector values in quotes — add_quotes","title":"Put vector values in quotes — add_quotes","text":"Put vector values quotes","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_quotes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Put vector values in quotes — add_quotes","text":"","code":"add_quotes(x, quote = \"double\")"},{"path":"https://insightrx.github.io/PKPDsim/reference/add_quotes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Put vector values in quotes — add_quotes","text":"x vector string / numeric quote type quotes (`double` `single`)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_quotes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Put vector values in quotes — add_quotes","text":"Character vector input quotation marks around value","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv.html","id":null,"dir":"Reference","previous_headings":"","what":"Add residual variability to the dependent variable — add_ruv","title":"Add residual variability to the dependent variable — add_ruv","text":"Add residual variability dependent variable","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add residual variability to the dependent variable — add_ruv","text":"","code":"add_ruv(x, ruv = list(), obs_type = 1)"},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add residual variability to the dependent variable — add_ruv","text":"x dependent value without residual variability ruv list specifying proportional, additive /exponential errors (`prop`, `add`, `exp`) obs_type vector observation types","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add residual variability to the dependent variable — add_ruv","text":"Input vector residual variability added","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv_to_quantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the increase in a specific quantile for a distribution on y when residual variability is added — add_ruv_to_quantile","title":"Calculate the increase in a specific quantile for a distribution on y when residual variability is added — add_ruv_to_quantile","text":"Calculate increase specific quantile distribution y residual variability added","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv_to_quantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the increase in a specific quantile for a distribution on y when residual variability is added — add_ruv_to_quantile","text":"","code":"add_ruv_to_quantile(y, sd_y, log_scale = FALSE, q = NULL, ruv = list(), ...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv_to_quantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the increase in a specific quantile for a distribution on y when residual variability is added — add_ruv_to_quantile","text":"y y sd_y standard deviation y without residual variability added. add normally distributed variability (potentially log-scale). log_scale add variability log scale (FALSE default, DEPRECATED!). q quantile ruv list residual variability (`prop` `add`) ... passed arguments","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/add_ruv_to_quantile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the increase in a specific quantile for a distribution on y when residual variability is added — add_ruv_to_quantile","text":"Numeric vector y values residual variability","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_binomial.html","id":null,"dir":"Reference","previous_headings":"","what":"Binomial adherence — adherence_binomial","title":"Binomial adherence — adherence_binomial","text":"Model adherence binomial probability time occasion.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_binomial.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Binomial adherence — adherence_binomial","text":"","code":"adherence_binomial(n = 100, prob)"},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_binomial.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Binomial adherence — adherence_binomial","text":"n number occasions prob binomial probability","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_binomial.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Binomial adherence — adherence_binomial","text":"Returns vector length `n` containing values 0 (non-adherent) 1 (adherent). Numeric vector length n","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_markov.html","id":null,"dir":"Reference","previous_headings":"","what":"Markov adherence model — adherence_markov","title":"Markov adherence model — adherence_markov","text":"Model adherence markov chain model, based probability staying adherent becoming adherent non-adherent. Assumes patients start adherent.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_markov.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Markov adherence model — adherence_markov","text":"","code":"adherence_markov(n = 100, p11 = 0.9, p01 = 0.7)"},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_markov.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Markov adherence model — adherence_markov","text":"n number occasions p11 probability staying adherent p01 probability going non-adherent adherent state","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/adherence_markov.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Markov adherence model — adherence_markov","text":"Returns vector length `n` containing values 0 (non-adherent) 1 (adherent). Numeric vector length n","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan.html","id":null,"dir":"Reference","previous_headings":"","what":"ADVAN-style functions to calculate linear PK systems — advan","title":"ADVAN-style functions to calculate linear PK systems — advan","text":"ADVAN-style functions calculate linear PK systems","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ADVAN-style functions to calculate linear PK systems — advan","text":"","code":"advan(model, cpp = TRUE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/advan.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ADVAN-style functions to calculate linear PK systems — advan","text":"model Standard linear PK model, e.g. `pk_1cmt_iv_bolus`. cpp use C++-versions model (~50x faster R implementations)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ADVAN-style functions to calculate linear PK systems — advan","text":"Model function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_create_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Create ADVAN-style dataset — advan_create_data","title":"Create ADVAN-style dataset — advan_create_data","text":"Create ADVAN-style dataset","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_create_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create ADVAN-style dataset — advan_create_data","text":"","code":"advan_create_data( regimen, parameters, cmts = 5, t_obs = NULL, covariates = NULL, covariate_model = NULL )"},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_create_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create ADVAN-style dataset — advan_create_data","text":"regimen PKPDsim regimen parameters list parameters cmts number compartments, minimum 1. Default 5, enough linear PK models. OK compartments available actually used. t_obs add observation timepoints dataset covariates covariate list covariate_model covariate model equations, written C","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_create_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create ADVAN-style dataset — advan_create_data","text":"Data frame ADVAN-style data","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_parse_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal function to parse the raw output from ADVAN-style functions — advan_parse_output","title":"Internal function to parse the raw output from ADVAN-style functions — advan_parse_output","text":"Internal function parse raw output ADVAN-style functions","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_parse_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal function to parse the raw output from ADVAN-style functions — advan_parse_output","text":"","code":"advan_parse_output(data, cmts = 1, t_obs, extra_t_obs = TRUE, regimen)"},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_parse_output.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal function to parse the raw output from ADVAN-style functions — advan_parse_output","text":"data simulation output data cmts number compartments t_obs observation times extra_t_obs leave extra added dose times dataset? regimen PKPDsim regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_parse_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Internal function to parse the raw output from ADVAN-style functions — advan_parse_output","text":"Data frame containing parsed simulation data","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_process_infusion_doses.html","id":null,"dir":"Reference","previous_headings":"","what":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","title":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","text":"Function adapted code Abuhelwa, Foster, Upton JPET 2015. cleaned somewhat optimized. Can potentially optimized .","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_process_infusion_doses.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","text":"","code":"advan_process_infusion_doses(data)"},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_process_infusion_doses.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","text":"data ADVAN-style dataset, e.g. created using `advan_create_data`.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_process_infusion_doses.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","text":"Data frame containing additional RATEALL column.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/advan_process_infusion_doses.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Add column RATEALL to ADVAN-style dataset to handle infusions — advan_process_infusion_doses","text":"Abuhelwa, . Y., Foster, D. J. R., Upton, R. N. (2015) ADVAN-style analytical solutions common pharmacokinetic models. J Pharmacol Toxicol Methods 73:42-8. DOI: 10.1016/j.vascn.2015.03.004","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/analytical_eqn_wrapper.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrapper for using analytical equations with PKPD regimens — analytical_eqn_wrapper","title":"Wrapper for using analytical equations with PKPD regimens — analytical_eqn_wrapper","text":"development. Needs optimized significantly useful production.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/analytical_eqn_wrapper.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrapper for using analytical equations with PKPD regimens — analytical_eqn_wrapper","text":"","code":"analytical_eqn_wrapper(analytical, design = NULL, parameters)"},{"path":"https://insightrx.github.io/PKPDsim/reference/analytical_eqn_wrapper.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrapper for using analytical equations with PKPD regimens — analytical_eqn_wrapper","text":"analytical analytical equation, taking parameters `amt`, `parameters`, `t`, returning vector values `y` design design dataset created `sim_ode` parameters list parameters","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/apply_lagtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply lagtime to a regimen — apply_lagtime","title":"Apply lagtime to a regimen — apply_lagtime","text":"Apply lagtime regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/apply_lagtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply lagtime to a regimen — apply_lagtime","text":"","code":"apply_lagtime(regimen, lagtime, parameters, cmt_mapping = NULL)"},{"path":"https://insightrx.github.io/PKPDsim/reference/apply_lagtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply lagtime to a regimen — apply_lagtime","text":"regimen PKPDsim regimen lagtime lagtime object, either single value / parameter name vector values/parameter names compartments. parameters parameter list, required parameters specified. cmt_mapping map administration types compartments, e.g. `list(\"oral\" = 1, \"infusion\" = 2, \"bolus\" = 2)`.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/apply_lagtime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply lagtime to a regimen — apply_lagtime","text":"Original regimen lagtime added dose times","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/bioavailability_to_R_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Transforms bioavailability specs into appropriate R code — bioavailability_to_R_code","title":"Transforms bioavailability specs into appropriate R code — bioavailability_to_R_code","text":"Specialized wrapper around `vector_to_R_code` makes reasonable PK assumptions bioavailability specification NULL.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/bioavailability_to_R_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transforms bioavailability specs into appropriate R code — bioavailability_to_R_code","text":"","code":"bioavailability_to_R_code(bioav)"},{"path":"https://insightrx.github.io/PKPDsim/reference/bioavailability_to_R_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transforms bioavailability specs into appropriate R code — bioavailability_to_R_code","text":"bioav bioavailability specification, either NULL (assume value 1 compartments), single value (assume applies compartments), vector values.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/bioavailability_to_R_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Transforms bioavailability specs into appropriate R code — bioavailability_to_R_code","text":"character string length 1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_dydP.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate derivative — calc_dydP","title":"Calculate derivative — calc_dydP","text":"Calculate derivative","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_dydP.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate derivative — calc_dydP","text":"","code":"calc_dydP(dy, y, rel_delta, log_y)"},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_dydP.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate derivative — calc_dydP","text":"dy dy y dependent value rel_delta relative delta log_y logical indicating dependent variable log transformed","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_ss_analytic.html","id":null,"dir":"Reference","previous_headings":"","what":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","title":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","text":"Basically performs PK simulation using analytic equations instead ODEs steady state (n=45 days, increased needed).","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_ss_analytic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","text":"","code":"calc_ss_analytic( f = \"1cmt_oral\", dose, interval, t_inf = NULL, model, parameters, covariates = NULL, map = NULL, n_days = 45, n_transit_compartments = 0, auc = FALSE )"},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_ss_analytic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","text":"f analytic equation use, must one `names(advan_funcs)` dose dose interval interval t_inf infusion time model PKPDsim model parameters parameters list covariates covariates list map list remapping parameters, ex: `list(CL = \"CL\", V = \"V\")` n_days number days assume steady state. Default 45. n_transit_compartments number transit compartments, insert n compartments first (dose) compartment second (central) compartment. auc add (empty) AUC compartment end state vector?","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_ss_analytic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","text":"State vector linear pharmacokinetic system steady state","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calc_ss_analytic.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Returns the state of a linear PK system at steady state (trough)\nusing analytics equations (so for linear PK systems only). — calc_ss_analytic","text":"can also used models transit compartments, however, assumption made end dosing interval amount transit compartments negligible (0).","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calculate_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate model-specific variables using a dummy call to sim_ode() — calculate_parameters","title":"Calculate model-specific variables using a dummy call to sim_ode() — calculate_parameters","text":"convenience function PKPDsim users, used inside `sim_ode()`` function way. function useful converting estimated parameter actual parameter, e.g. clearance specified `CLi = CL * (WT/70) * (1/CR)` can used calculate `CLi` without write function second time R.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calculate_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate model-specific variables using a dummy call to sim_ode() — calculate_parameters","text":"","code":"calculate_parameters( ode = NULL, parameters = NULL, covariates = NULL, include_parameters = TRUE, include_variables = TRUE, ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/calculate_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate model-specific variables using a dummy call to sim_ode() — calculate_parameters","text":"ode PKPDsim model object parameters parameter list covariates covariate list. Make sure include covariates right time point, since last observed covariate values used. include_parameters boolean, include parameters? include_variables boolean, include variables? ... arguments pass simulation function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/calculate_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate model-specific variables using a dummy call to sim_ode() — calculate_parameters","text":"List model-specific variables","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_iov_specification.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks that IOV was specified appropriately — check_iov_specification","title":"Checks that IOV was specified appropriately — check_iov_specification","text":"Inter-occasion variability (IOV) expected supplied list `cv` `n_bins` specified. `cv` expected named list IOV PK parameter. function checks ensure PK code ODE code contains IOV term PK parameter specified.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_iov_specification.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks that IOV was specified appropriately — check_iov_specification","text":"","code":"check_iov_specification(iov, code, pk_code)"},{"path":"https://insightrx.github.io/PKPDsim/reference/check_iov_specification.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks that IOV was specified appropriately — check_iov_specification","text":"iov IOV specifications, provided nested named list. code C++ ODE code, supplied string pk_code C++ PK code, supplied string","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_mixture_model.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that mixture model is specified in right format and within constraints (1 parameter, 2 groups) — check_mixture_model","title":"Check that mixture model is specified in right format and within constraints (1 parameter, 2 groups) — check_mixture_model","text":"Check mixture model specified right format within constraints (1 parameter, 2 groups)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_mixture_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that mixture model is specified in right format and within constraints (1 parameter, 2 groups) — check_mixture_model","text":"","code":"check_mixture_model(mixture, parameters)"},{"path":"https://insightrx.github.io/PKPDsim/reference/check_mixture_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that mixture model is specified in right format and within constraints (1 parameter, 2 groups) — check_mixture_model","text":"mixture mixture model specification (list, e.g. `list(\"CL\" = list(values=c(5, 10), probability=0.3))`) parameters vector parameter names","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_obs_input.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks obs input for valid combinations of cmt, var, scale — check_obs_input","title":"Checks obs input for valid combinations of cmt, var, scale — check_obs_input","text":"Checks obs input valid combinations cmt, var, scale","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/check_obs_input.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks obs input for valid combinations of cmt, var, scale — check_obs_input","text":"","code":"check_obs_input(obs)"},{"path":"https://insightrx.github.io/PKPDsim/reference/check_obs_input.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks obs input for valid combinations of cmt, var, scale — check_obs_input","text":"obs specified observation object including least description variable(s) associated particular compartment, e.g. `list(variable=\"CONC\", scale=\"1\")`.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/compile_sim_cpp.html","id":null,"dir":"Reference","previous_headings":"","what":"Compile ODE model to c++ function — compile_sim_cpp","title":"Compile ODE model to c++ function — compile_sim_cpp","text":"Compile ODE model c++ function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/compile_sim_cpp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compile ODE model to c++ function — compile_sim_cpp","text":"","code":"compile_sim_cpp( code, dose_code, pk_code, size, p, cpp_show_code, code_init = NULL, state_init = NULL, declare_variables = NULL, variables = NULL, covariates = NULL, obs = NULL, dose = NULL, iov = NULL, compile = TRUE, verbose = FALSE, as_is = FALSE )"},{"path":"https://insightrx.github.io/PKPDsim/reference/compile_sim_cpp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compile ODE model to c++ function — compile_sim_cpp","text":"code C++ code ODE system dose_code C++ code per dose event pk_code C++ code per event (similar $PK) size size ODE system p parameters (list) cpp_show_code show output c++ function? code_init code initialization state state_init state init vector declare_variables variable declaration required variables (including user-specified) variables user-specified variables covariates covariates specification obs observation specification dose dose specification iov iov specification compile compile ? verbose show output as_is use C-code -, substitute line-endings shift indices","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/compile_sim_cpp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compile ODE model to c++ function — compile_sim_cpp","text":"List containing ODE definition C++ code simulation function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariate_last_obs_only.html","id":null,"dir":"Reference","previous_headings":"","what":"Use only last observed covariate values — covariate_last_obs_only","title":"Use only last observed covariate values — covariate_last_obs_only","text":"Use last observed covariate values","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariate_last_obs_only.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use only last observed covariate values — covariate_last_obs_only","text":"","code":"covariate_last_obs_only(covariates)"},{"path":"https://insightrx.github.io/PKPDsim/reference/covariate_last_obs_only.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use only last observed covariate values — covariate_last_obs_only","text":"covariates covariates object","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariate_last_obs_only.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Use only last observed covariate values — covariate_last_obs_only","text":"List containing elements input covariate object including last value covariate","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariates_table_to_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert covariate table specified as data.frame — covariates_table_to_list","title":"Convert covariate table specified as data.frame — covariates_table_to_list","text":"Can handle time-varying data , `t` `time` specified column","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariates_table_to_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert covariate table specified as data.frame — covariates_table_to_list","text":"","code":"covariates_table_to_list(covariates_table, covariates_implementation = list())"},{"path":"https://insightrx.github.io/PKPDsim/reference/covariates_table_to_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert covariate table specified as data.frame — covariates_table_to_list","text":"covariates_table `data.frame`` covariates columns. Potentially `id` `t` columns covariates_implementation `list` implementation method per covariate","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/covariates_table_to_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert covariate table specified as data.frame — covariates_table_to_list","text":"List covariates","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/create_event_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Create an event table — create_event_table","title":"Create an event table — create_event_table","text":"Create event table","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/create_event_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create an event table — create_event_table","text":"","code":"create_event_table( regimen, t_max = NULL, t_obs = NULL, t_tte = NULL, t_init = 0, p, covariates, model = NULL, obs_type = NULL )"},{"path":"https://insightrx.github.io/PKPDsim/reference/create_event_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create an event table — create_event_table","text":"regimen regimen t_max t_max t_obs t_obs t_tte t_tte t_init t_init p parameters covariates covariates model model obs_type observation type","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/create_obs_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Create obs data — create_obs_data","title":"Create obs data — create_obs_data","text":"Used sim() arrange data ode() function correct format.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/create_obs_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create obs data — create_obs_data","text":"","code":"create_obs_data(ode_data, obs_attr, id)"},{"path":"https://insightrx.github.io/PKPDsim/reference/create_obs_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create obs data — create_obs_data","text":"ode_data data frame output ode() function obs_attr \"obs\" attribute ode() function id ID individual","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/cv_to_omega.html","id":null,"dir":"Reference","previous_headings":"","what":"Create lower-diagonal omega matrix from CV for parameter estimates — cv_to_omega","title":"Create lower-diagonal omega matrix from CV for parameter estimates — cv_to_omega","text":"Create lower-diagonal omega matrix CV parameter estimates","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/cv_to_omega.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create lower-diagonal omega matrix from CV for parameter estimates — cv_to_omega","text":"","code":"cv_to_omega(par_cv = NULL, parameters = NULL)"},{"path":"https://insightrx.github.io/PKPDsim/reference/cv_to_omega.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create lower-diagonal omega matrix from CV for parameter estimates — cv_to_omega","text":"par_cv list parameter CVs parameters list parameters","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/cv_to_omega.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create lower-diagonal omega matrix from CV for parameter estimates — cv_to_omega","text":"vector describing lower triangle omega (-subject variability) matrix","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/define_tdm_init_model.html","id":null,"dir":"Reference","previous_headings":"","what":"defines C code for TDM before dose conditions — define_tdm_init_model","title":"defines C code for TDM before dose conditions — define_tdm_init_model","text":"Currently available 1-cmt 2-cmt IV models","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/define_tdm_init_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"defines C code for TDM before dose conditions — define_tdm_init_model","text":"","code":"define_tdm_init_model(def)"},{"path":"https://insightrx.github.io/PKPDsim/reference/define_tdm_init_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"defines C code for TDM before dose conditions — define_tdm_init_model","text":"def model definition, named recursive list least objects `misc$model_type`, `parameters` `variables`","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/define_tdm_init_model.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"defines C code for TDM before dose conditions — define_tdm_init_model","text":"model defintion `state_init` object added describing initializing compartments.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/detect_ode_syntax.html","id":null,"dir":"Reference","previous_headings":"","what":"Auto-detect the syntax for the ODE code — detect_ode_syntax","title":"Auto-detect the syntax for the ODE code — detect_ode_syntax","text":"Either PKPDsim RxODE","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/detect_ode_syntax.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Auto-detect the syntax for the ODE code — detect_ode_syntax","text":"","code":"detect_ode_syntax(code)"},{"path":"https://insightrx.github.io/PKPDsim/reference/detect_ode_syntax.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Auto-detect the syntax for the ODE code — detect_ode_syntax","text":"code character string ODE code","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/detect_ode_syntax.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Auto-detect the syntax for the ODE code — detect_ode_syntax","text":"List elements indicating syntax ODE code","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/f_cov.html","id":null,"dir":"Reference","previous_headings":"","what":"covariate function builder — f_cov","title":"covariate function builder — f_cov","text":"covariate function builder","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/f_cov.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"covariate function builder — f_cov","text":"","code":"f_cov(...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/f_cov.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"covariate function builder — f_cov","text":"... parameters pass cov","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/f_cov.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"covariate function builder — f_cov","text":"Covariate function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_fixed_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Get fixed parameters — get_fixed_parameters","title":"Get fixed parameters — get_fixed_parameters","text":"Get fixed parameters listed model definition.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_fixed_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get fixed parameters — get_fixed_parameters","text":"","code":"get_fixed_parameters(def)"},{"path":"https://insightrx.github.io/PKPDsim/reference/get_fixed_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get fixed parameters — get_fixed_parameters","text":"def Model definition output read_model_json()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_ode_model_size.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the number of states in the ODE from the code\ncode C++ code for model — get_ode_model_size","title":"Get the number of states in the ODE from the code\ncode C++ code for model — get_ode_model_size","text":"Get number states ODE code code C++ code model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_ode_model_size.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the number of states in the ODE from the code\ncode C++ code for model — get_ode_model_size","text":"","code":"get_ode_model_size(code)"},{"path":"https://insightrx.github.io/PKPDsim/reference/get_ode_model_size.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the number of states in the ODE from the code\ncode C++ code for model — get_ode_model_size","text":"code C++ code","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_ode_model_size.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the number of states in the ODE from the code\ncode C++ code for model — get_ode_model_size","text":"Number states ODE model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_parameters_from_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Get model parameters from code — get_parameters_from_code","title":"Get model parameters from code — get_parameters_from_code","text":"Get model parameters code","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_parameters_from_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get model parameters from code — get_parameters_from_code","text":"","code":"get_parameters_from_code(code, state_init, declare_variables = NULL)"},{"path":"https://insightrx.github.io/PKPDsim/reference/get_parameters_from_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get model parameters from code — get_parameters_from_code","text":"code code state_init state init vector declare_variables declared variables","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_parameters_from_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get model parameters from code — get_parameters_from_code","text":"Vector parameter names","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_t_obs_from_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract sensible default observation times from a specified regimen — get_t_obs_from_regimen","title":"Extract sensible default observation times from a specified regimen — get_t_obs_from_regimen","text":"Extract sensible default observation times specified regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_t_obs_from_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract sensible default observation times from a specified regimen — get_t_obs_from_regimen","text":"","code":"get_t_obs_from_regimen( regimen = NULL, obs_step_size = NULL, t_max = NULL, covariates = NULL, extra_t_obs = NULL, t_init = 0 )"},{"path":"https://insightrx.github.io/PKPDsim/reference/get_t_obs_from_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract sensible default observation times from a specified regimen — get_t_obs_from_regimen","text":"regimen regimen created using `new_regimen()` obs_step_size step size observations. auto-calculated NULL t_max max time value covariates covariates object, created using `list(new_covariate(), ...)` extra_t_obs add timepoints t_obs covariate changing (`T`/`F`) t_init time initiation ODE system. Usually 0.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_var_y.html","id":null,"dir":"Reference","previous_headings":"","what":"Get expected variance/sd/ci of dependent variable\nbased on PKPDsim model, parameters, and regimen — get_var_y","title":"Get expected variance/sd/ci of dependent variable\nbased on PKPDsim model, parameters, and regimen — get_var_y","text":"Get expected variance/sd/ci dependent variable based PKPDsim model, parameters, regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_var_y.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get expected variance/sd/ci of dependent variable\nbased on PKPDsim model, parameters, and regimen — get_var_y","text":"","code":"get_var_y( model = NULL, parameters = list(), regimen = list(), t_obs = c(1:48), obs_comp = NULL, obs_variable = NULL, omega = c(0.1, 0.05, 0.1), omega_full = NULL, n_ind = NULL, ruv = NULL, y = NULL, rel_delta = 1e-04, method = \"delta\", sequence = NULL, auc = FALSE, sd = TRUE, q = NULL, in_parallel = FALSE, n_cores = 3, return_all = FALSE, ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/get_var_y.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get expected variance/sd/ci of dependent variable\nbased on PKPDsim model, parameters, and regimen — get_var_y","text":"model model, created using `PKPDsim::new_ode_model()` parameters parameters list regimen regimen, created using `PKPDsim::new_regimen()` t_obs vector observation times obs_comp observation compartment. NULL \"obs\" (default) obs_variable observation variable. NULL, ignored, otherwise override `obs_comp`. omega triangle omega block omega_full full omega block n_ind number individuals simulate sim method ruv residual variability, supplied named list, ex: `list(prop = 0, add = 0, exp = 0)` y vector observations. NULL, new simulation performed. rel_delta rel_delta method method, `delta` `sim` sequence simulations, NULL pseudo-random sequence use, e.g. \"halton\" \"sobol\". See `mvrnorm2` details. auc AUC? sd return standard deviation (`TRUE`) variance (`FALSE`) q return vector quantiles instead sd/var. return parametric quantiles delta-method used, non-parametric simulation-based methods. in_parallel run simulations parallel? n_cores run parallel, many cores? return_all return object relevant information? ... passed `sim_ode()`","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/get_var_y.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get expected variance/sd/ci of dependent variable\nbased on PKPDsim model, parameters, and regimen — get_var_y","text":"Vector standard deviations variances (quantiles thereof) dependent value variable","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ifelse0.html","id":null,"dir":"Reference","previous_headings":"","what":"ifelse function but then based on whether value is NULL or not — ifelse0","title":"ifelse function but then based on whether value is NULL or not — ifelse0","text":"ifelse function based whether value NULL ","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ifelse0.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ifelse function but then based on whether value is NULL or not — ifelse0","text":"","code":"ifelse0(value = NULL, alternative = NULL, allow_null = FALSE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/ifelse0.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ifelse function but then based on whether value is NULL or not — ifelse0","text":"value metadata list object alternative alternative value allow_null can alternative NULL?","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/ifelse0.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ifelse function but then based on whether value is NULL or not — ifelse0","text":"value non-NULL; alternative otherwise","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/is_newer_package.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if package number is different from currently installed,\nand provide some messaging. — is_newer_package","title":"Check if package number is different from currently installed,\nand provide some messaging. — is_newer_package","text":"Technically checks package version different, necessarily higher version number.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/is_newer_package.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if package number is different from currently installed,\nand provide some messaging. — is_newer_package","text":"","code":"is_newer_package(package, new_version)"},{"path":"https://insightrx.github.io/PKPDsim/reference/is_newer_package.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if package number is different from currently installed,\nand provide some messaging. — is_newer_package","text":"package R package new_version new version number","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/is_positive_definite.html","id":null,"dir":"Reference","previous_headings":"","what":"Is matrix positive definite — is_positive_definite","title":"Is matrix positive definite — is_positive_definite","text":"matrix positive definite","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/is_positive_definite.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is matrix positive definite — is_positive_definite","text":"","code":"is_positive_definite(x)"},{"path":"https://insightrx.github.io/PKPDsim/reference/is_positive_definite.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is matrix positive definite — is_positive_definite","text":"x matrix, specified either vector lower triangle, full matrix (matrix class)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/is_positive_definite.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Is matrix positive definite — is_positive_definite","text":"TRUE x positive definite; FALSE otherwise.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_cov_and_par.html","id":null,"dir":"Reference","previous_headings":"","what":"Combines covariates and parameters into a single list, useful for reparametrization of the model. — join_cov_and_par","title":"Combines covariates and parameters into a single list, useful for reparametrization of the model. — join_cov_and_par","text":"Combines covariates parameters single list, useful reparametrization model.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_cov_and_par.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combines covariates and parameters into a single list, useful for reparametrization of the model. — join_cov_and_par","text":"","code":"join_cov_and_par(covs, pars)"},{"path":"https://insightrx.github.io/PKPDsim/reference/join_cov_and_par.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combines covariates and parameters into a single list, useful for reparametrization of the model. — join_cov_and_par","text":"covs covariates object pars model parameters, output `parameters()` call frmo model library.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_cov_and_par.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combines covariates and parameters into a single list, useful for reparametrization of the model. — join_cov_and_par","text":"List containing covariates parameters","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Join two dosing regimens — join_regimen","title":"Join two dosing regimens — join_regimen","text":"Join two dosing regimens","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Join two dosing regimens — join_regimen","text":"","code":"join_regimen( regimen1 = NULL, regimen2 = NULL, interval = NULL, dose_update = NULL, t_dose_update = NULL, continuous = FALSE )"},{"path":"https://insightrx.github.io/PKPDsim/reference/join_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Join two dosing regimens — join_regimen","text":"regimen1 first regimen regimen2 second regimen interval interval regimen1 regimen2 (dose_update specified) dose_update dose number override regimen1 regimen 2 (interval specified) t_dose_update dose time update regimen continuous joining continuous infusions","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/join_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Join two dosing regimens — join_regimen","text":"Joined regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/lower_triangle_mat_size.html","id":null,"dir":"Reference","previous_headings":"","what":"Size of the lower triangle of the matrix — lower_triangle_mat_size","title":"Size of the lower triangle of the matrix — lower_triangle_mat_size","text":"Size lower triangle matrix","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/lower_triangle_mat_size.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Size of the lower triangle of the matrix — lower_triangle_mat_size","text":"","code":"lower_triangle_mat_size(mat)"},{"path":"https://insightrx.github.io/PKPDsim/reference/lower_triangle_mat_size.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Size of the lower triangle of the matrix — lower_triangle_mat_size","text":"mat omega matrix vector","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/merge_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Merge two regimens together. — merge_regimen","title":"Merge two regimens together. — merge_regimen","text":"contrast `join_regimen`, joins two consecutive regimens together, `merge_regimen` merges two regimens given time. can e.g. used define regimens multi-drug models.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/merge_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Merge two regimens together. — merge_regimen","text":"","code":"merge_regimen(regimens)"},{"path":"https://insightrx.github.io/PKPDsim/reference/merge_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Merge two regimens together. — merge_regimen","text":"regimens List PKPDsim regimens created `new_regimen`.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/merge_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Merge two regimens together. — merge_regimen","text":"Merged regimens","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_from_api.html","id":null,"dir":"Reference","previous_headings":"","what":"Load model definition from API, and compile to R library — model_from_api","title":"Load model definition from API, and compile to R library — model_from_api","text":"Load model definition API, compile R library","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_from_api.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Load model definition from API, and compile to R library — model_from_api","text":"","code":"model_from_api( url, model = NULL, nonmem = NULL, verbose = TRUE, get_definition = FALSE, to_package = FALSE, force = FALSE, install_all = FALSE, ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/model_from_api.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load model definition from API, and compile to R library — model_from_api","text":"url URL file path JSON representation model model model id (used messages) nonmem URL file path NONMEM file verbose verbosity (T/F) get_definition return model definition, compile to_package compile package? force force install even version number model already installed. install_all force install , even model inactive ... arguments passed new_ode_model() function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_from_api.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Load model definition from API, and compile to R library — model_from_api","text":"Model object created new_ode_model()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_library.html","id":null,"dir":"Reference","previous_headings":"","what":"Model library — model_library","title":"Model library — model_library","text":"Model library","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_library.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Model library — model_library","text":"","code":"model_library(name = NULL)"},{"path":"https://insightrx.github.io/PKPDsim/reference/model_library.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Model library — model_library","text":"name name model library. none specified, show list available models.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/model_library.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Model library — model_library","text":"List containing information named model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/mvrnorm2.html","id":null,"dir":"Reference","previous_headings":"","what":"More powerful multivariate normal sampling function — mvrnorm2","title":"More powerful multivariate normal sampling function — mvrnorm2","text":"Besides standard multivariate normal sampling (mvrnorm), allows exponential multivariate normal quasi-random multivariate normal (using randtoolbox) using interface.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/mvrnorm2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"More powerful multivariate normal sampling function — mvrnorm2","text":"","code":"mvrnorm2(n, mu, Sigma, exponential = FALSE, sequence = NULL, ...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/mvrnorm2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"More powerful multivariate normal sampling function — mvrnorm2","text":"n number samples mu mean Sigma covariance matrix exponential exponential distribution (.e. multiply mu exponential sampled numbers) sequence sequence available randtoolbox, e.g. `halton`, `sobol` ... parameters passed mvrnorm randtoolbox sequence generator","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/mvrnorm2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"More powerful multivariate normal sampling function — mvrnorm2","text":"Multivariate normal samples","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/na_locf.html","id":null,"dir":"Reference","previous_headings":"","what":"Fill in NAs with the previous non-missing value — na_locf","title":"Fill in NAs with the previous non-missing value — na_locf","text":"Inspired zoo::na.locf0","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/na_locf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fill in NAs with the previous non-missing value — na_locf","text":"","code":"na_locf(object, fromLast = FALSE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/na_locf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fill in NAs with the previous non-missing value — na_locf","text":"object object fromLast logical. Causes observations carried backward rather forward. Default FALSE.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/na_locf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fill in NAs with the previous non-missing value — na_locf","text":"Original object NAs filled ","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_adherence.html","id":null,"dir":"Reference","previous_headings":"","what":"Probabilistically model adherence — new_adherence","title":"Probabilistically model adherence — new_adherence","text":"Model drug adherence using either binomial probability distribution markov chain model based probability staying adherent becoming adherent non-adherent.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_adherence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Probabilistically model adherence — new_adherence","text":"","code":"new_adherence( n = 100, type = c(\"markov\", \"binomial\"), p_markov_remain_ad = 0.75, p_markov_become_ad = 0.75, p_binom = 0.7 )"},{"path":"https://insightrx.github.io/PKPDsim/reference/new_adherence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Probabilistically model adherence — new_adherence","text":"n number occasions simulate type type adherence simulation, either \"markov\" \"binomial\" p_markov_remain_ad markov probability staying adherent p_markov_become_ad markov probability going non-adherent adherent state p_binom binomial probability adherent","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_adherence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Probabilistically model adherence — new_adherence","text":"Returns vector length `n` containing values 0 (non-adherent) 1 (adherent). Numeric vector length n","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate.html","id":null,"dir":"Reference","previous_headings":"","what":"New covariate — new_covariate","title":"New covariate — new_covariate","text":"Describe data covariate, either fixed time-variant","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"New covariate — new_covariate","text":"","code":"new_covariate( value = NULL, times = NULL, implementation = c(\"interpolate\", \"locf\"), unit = NULL, interpolation_join_limit = 1, remove_negative_times = TRUE, round_times = NULL, comments = NULL, verbose = TRUE )"},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"New covariate — new_covariate","text":"value numeric vector times NULL time-invariant covariate numeric vector specifying update times covariate implementation time-varying covariates either 'locf' (last observation carried forward) 'interpolate' (default). Non-numeric covariate values assumed locf. unit specify covariate unit (optional, documentation purposes ) interpolation_join_limit interpolate option, covariate timepoints spaced close together, ODE solver sometimes chokes. argument sets lower limit space timepoints. create average values joint timepoints instead. undesired set NULL 0. remove_negative_times times zero discarded (value time zero determined based implementation argument), TRUE FALSE. round_times round times specified number digits. NULL, round. comments NULL, vector length equal value specifying comments observation (optional, documentation ) verbose verbosity","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"New covariate — new_covariate","text":"Object class \"covariate\"","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate_model.html","id":null,"dir":"Reference","previous_headings":"","what":"covariate model function — new_covariate_model","title":"covariate model function — new_covariate_model","text":"covariate model function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"covariate model function — new_covariate_model","text":"","code":"new_covariate_model(model = list())"},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"covariate model function — new_covariate_model","text":"model covariate model specified list","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_covariate_model.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"covariate model function — new_covariate_model","text":"List containing model function(s)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_ode_model.html","id":null,"dir":"Reference","previous_headings":"","what":"Create new ODE model — new_ode_model","title":"Create new ODE model — new_ode_model","text":"Create new ODE model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_ode_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create new ODE model — new_ode_model","text":"","code":"new_ode_model( model = NULL, code = NULL, pk_code = NULL, dose_code = NULL, file = NULL, func = NULL, state_init = NULL, parameters = NULL, reparametrization = NULL, mixture = NULL, units = NULL, size = NULL, lagtime = NULL, obs = list(cmt = 1, scale = 1), dose = list(cmt = 1), covariates = NULL, declare_variables = NULL, iiv = NULL, iov = NULL, development = NULL, omega_matrix = NULL, ruv = NULL, ltbs = NULL, misc = NULL, cmt_mapping = NULL, int_step_size = NULL, default_parameters = NULL, fixed = NULL, cpp_show_code = FALSE, package = NULL, test_file = NULL, install = TRUE, folder = NULL, lib_location = NULL, verbose = FALSE, as_is = FALSE, nonmem = NULL, comments = NULL, version = \"0.1.0\", quiet = \"\", definition = NULL )"},{"path":"https://insightrx.github.io/PKPDsim/reference/new_ode_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create new ODE model — new_ode_model","text":"model model name model library code C++ code specifying ODE system pk_code C++ code called event dose_code C++ code called dose event file file containing C++ code func R function used deSolve library state_init vector state init parameters list vector parameter values reparametrization list parameters definitions reparametrize linear PK model 1-, 2- o4 3-compartment PK standardized parametrization. mixture mixture models, provide list parameter associated mixture possible values probabilities (first value), e.g. `list(CL = list(value = c(10, 20), probability = 0.3)`. units list vector parameter units size size state vector model. Size extracted automatically supplied code, use argument override. lagtime lag time obs list \"scale\": character string definition scale, e.g. \"V\" \"V*(WT/70)\". NULL, scale defaults 1., \"cmt\" observation compartment dose specify default dose compartment, e.g. list(cmt = 1) covariates specify covariates, either character vector list. specified list, allows use timevarying covariates (see `new_covariate()` function info) declare_variables declare variables iiv inter-individual variability, can optionally added library iov inter-occasion variability, can optionally added library development Information model development population, can optionally added library omega_matrix variance-covariance matrix inter-individual variability, can optionally added library ruv residual variability, can optionally added library ltbs log-transform sides. used simulations, fitting (sets attribute `ltbs`). misc list miscellaneous model metadata cmt_mapping list indicating administration routes apply compartments. Example: `list(\"oral\" = 1, \"infusion\" = 2)` int_step_size step size integrator. Can pre-specified model, override default `sim_ode()` default_parameters population specific patient values, can optionally added library fixed parameters iiv added. cpp_show_code show generated C++ code package package name saving package test_file optional test file included package install install package compilation? folder base folder name create package lib_location install folder (`--library` argument) verbose show output as_is use C-code -, substitute line-endings shift indices nonmem add nonmem code attribute model object comments comments model version number library quiet passed `system2` setting stderr stdout; output cmd line output. Default (`\"\"`) R console, NULL FALSE discards. TRUE captures output saves file. definition optional, filename JSON file full definition model. definition file stored `definition.json` resulting package.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_ode_model.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create new ODE model — new_ode_model","text":"package name NULL, returns model object. Otherwise return value.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Dose regimen for sim_ode — new_regimen","title":"Dose regimen for sim_ode — new_regimen","text":"Create dosing regimen use sim_ode","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Dose regimen for sim_ode — new_regimen","text":"","code":"new_regimen( amt = 100, interval = NULL, n = 3, times = NULL, type = NULL, t_inf = NULL, rate = NULL, t_lag = NULL, cmt = NULL, checks = TRUE, ss = FALSE, n_ss = NULL, first_dose_time = now_utc() )"},{"path":"https://insightrx.github.io/PKPDsim/reference/new_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Dose regimen for sim_ode — new_regimen","text":"amt dosing amount, either single value (repeated multiple doses), vector doses administration interval dosing interval (requires n argument) n number doses (requires interval argument) times vector describing dosing times. Overrides specified times using interval n arguments type either \"infusion\", \"bolus\", \"oral\", \"sc\" (subcutaneous), \"im\" (intramuscular). t_inf infusion time (`type`==`infusion`) rate infusion rate (`type`==`infusion`). `NULL` default. specified, overrides `t_inf` t_lag lag time (can applied dose type, oral). just added `times` cmt vector dosing compartments (optional, NULL dosing compartment defined model used) checks input checks. Remove increase speed (e.g. population-level estimation optimal design) ss steady state? boolean value whether simulate steady state first (steady state based specified `amt` `interval`, `times` ignored). n_ss many doses simulate assumed steady state. Default 4 * 24 / `interval`. first_dose_time datetime stamp first dose (class `POSIXct`). Default current date time.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/new_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Dose regimen for sim_ode — new_regimen","text":"list containing calculated VPC information, ggplot2 object","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/new_regimen.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dose regimen for sim_ode — new_regimen","text":"","code":"r1 <- new_regimen(amt=50, interval=12, n=20) # dose 50mg, q12hrs for 10 days r2 <- new_regimen(amt=50, times=c(0:19)*12) # same, but using explicit times r3 <- new_regimen(amt=c(rep(100,4), rep(50,16)), times=c(0:19)*12) # first 4 doses higher dose"},{"path":"https://insightrx.github.io/PKPDsim/reference/nlmixr_parse_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to parse parameters for a model into a structure used by nlmixr — nlmixr_parse_parameters","title":"Function to parse parameters for a model into a structure used by nlmixr — nlmixr_parse_parameters","text":"Function parse parameters model structure used nlmixr","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/nlmixr_parse_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to parse parameters for a model into a structure used by nlmixr — nlmixr_parse_parameters","text":"","code":"nlmixr_parse_parameters( parameters = list(CL = 5, V = 50), omega = c(0.1, 0.05, 0.1), res_var = list(prop = 0.1, add = 1), fixed = c(), log_transform = TRUE, ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/nlmixr_parse_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to parse parameters for a model into a structure used by nlmixr — nlmixr_parse_parameters","text":"parameters list parameters omega vector describing lower-diagonal -subject variability matrix res_var residual variability. Expected list arguments `prop`, `add`, /`exp`. NULL default. fixed vector fixed parameters log_transform log-transform estimated parameters nlmixr? ... passed ","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/nlmixr_parse_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to parse parameters for a model into a structure used by nlmixr — nlmixr_parse_parameters","text":"List parameters can used nlmixr","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/nm_to_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a regimen from NONMEM data — nm_to_regimen","title":"Create a regimen from NONMEM data — nm_to_regimen","text":"Create regimen based NONMEM, NONMEM-like dataset","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/nm_to_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a regimen from NONMEM data — nm_to_regimen","text":"","code":"nm_to_regimen(data, reset_time = TRUE, first_only = FALSE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/nm_to_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a regimen from NONMEM data — nm_to_regimen","text":"data NONMEM-type dataset reset_time start time simulated patient 0, irrespective design dataset first_only use design first individual dataset","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/nm_to_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a regimen from NONMEM data — nm_to_regimen","text":"Regimen object","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/now_utc.html","id":null,"dir":"Reference","previous_headings":"","what":"Current time in UTC — now_utc","title":"Current time in UTC — now_utc","text":"Current time UTC","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/now_utc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Current time in UTC — now_utc","text":"","code":"now_utc()"},{"path":"https://insightrx.github.io/PKPDsim/reference/now_utc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Current time in UTC — now_utc","text":"POSIXct object containing current time UTC","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/parse_obs_types.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse observation types to simulation code — parse_obs_types","title":"Parse observation types to simulation code — parse_obs_types","text":"Parse observation types simulation code","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/parse_obs_types.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse observation types to simulation code — parse_obs_types","text":"","code":"parse_obs_types(obs, initial = FALSE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/parse_obs_types.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse observation types to simulation code — parse_obs_types","text":"obs specified observation object including least description variable(s) associated particular compartment, e.g. `list(variable=\"CONC\", scale=\"1\")`. initial initial code block C++ template initializes variables compartments (`TRUE`), second code block used rest dataset?","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pkdata.html","id":null,"dir":"Reference","previous_headings":"","what":"PK dataset — pkdata","title":"PK dataset — pkdata","text":"Example PK dataset","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pkdata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"PK dataset — pkdata","text":"","code":"pkdata"},{"path":"https://insightrx.github.io/PKPDsim/reference/pkdata.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"PK dataset — pkdata","text":"data frame 624 rows 12 variables NONMEM format","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pkpdsim_to_nlmixr.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a model generated with PKPDsim to an object for nlmixr — pkpdsim_to_nlmixr","title":"Convert a model generated with PKPDsim to an object for nlmixr — pkpdsim_to_nlmixr","text":"Convert model generated PKPDsim object nlmixr","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pkpdsim_to_nlmixr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a model generated with PKPDsim to an object for nlmixr — pkpdsim_to_nlmixr","text":"","code":"pkpdsim_to_nlmixr( model = NULL, parameters = NULL, omega = NULL, res_var = NULL, fixed = c(), ini_code = NULL, model_code = NULL, model_par_code = NULL, verbose = FALSE, ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/pkpdsim_to_nlmixr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a model generated with PKPDsim to an object for nlmixr — pkpdsim_to_nlmixr","text":"model PKPDsim model parameters list parameters omega vector describing lower-diagonal -subject variability matrix res_var residual variability. Expected list arguments `prop`, `add`, /`exp`. NULL default. fixed vector fixed (estimated) parameter names ini_code manually specify `ini` block nlmixr model_code manually specify `model` block nlmixr model_par_code manually specify parameters section inside `model` block nlmixr verbose verbose, `TRUE` `FALSE` ... passed ","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pkpdsim_to_nlmixr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert a model generated with PKPDsim to an object for nlmixr — pkpdsim_to_nlmixr","text":"nlmixr function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pop_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove n doses (from tail) of PKPDsim regimen — pop_regimen","title":"Remove n doses (from tail) of PKPDsim regimen — pop_regimen","text":"Opposite shift_regimen()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pop_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove n doses (from tail) of PKPDsim regimen — pop_regimen","text":"","code":"pop_regimen(regimen, n = 1)"},{"path":"https://insightrx.github.io/PKPDsim/reference/pop_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove n doses (from tail) of PKPDsim regimen — pop_regimen","text":"regimen PKPDsim regimen created using `new_regimen()` n number doses pop regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/pop_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove n doses (from tail) of PKPDsim regimen — pop_regimen","text":"Input regiment minus selected number doses","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/print.PKPDsim.html","id":null,"dir":"Reference","previous_headings":"","what":"Print function for PKPDsim simulation function — print.PKPDsim","title":"Print function for PKPDsim simulation function — print.PKPDsim","text":"Print function PKPDsim simulation function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.PKPDsim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print function for PKPDsim simulation function — print.PKPDsim","text":"","code":"# S3 method for PKPDsim print(x, ...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/print.PKPDsim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print function for PKPDsim simulation function — print.PKPDsim","text":"x function ... additional arguments","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.PKPDsim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print function for PKPDsim simulation function — print.PKPDsim","text":"return value, print function.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.covariate.html","id":null,"dir":"Reference","previous_headings":"","what":"Print function for PKPDsim covariate object — print.covariate","title":"Print function for PKPDsim covariate object — print.covariate","text":"Print function PKPDsim covariate object","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.covariate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print function for PKPDsim covariate object — print.covariate","text":"","code":"# S3 method for covariate print(x, ...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/print.covariate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print function for PKPDsim covariate object — print.covariate","text":"x covariate object ... additional arguments","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.covariate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print function for PKPDsim covariate object — print.covariate","text":"return value, print function.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Print function for PKPDsim regimen — print.regimen","title":"Print function for PKPDsim regimen — print.regimen","text":"Print function PKPDsim regimen","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print function for PKPDsim regimen — print.regimen","text":"","code":"# S3 method for regimen print(x, ...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/print.regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print function for PKPDsim regimen — print.regimen","text":"x regimen ... arguments pass","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print.regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print function for PKPDsim regimen — print.regimen","text":"return value, print function.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a list in R syntax — print_list","title":"Return a list in R syntax — print_list","text":"Return list R syntax","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a list in R syntax — print_list","text":"","code":"print_list(x, wrapper = TRUE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/print_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a list in R syntax — print_list","text":"x list printed wrapper wrap list object?","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/print_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a list in R syntax — print_list","text":"Original list R syntax","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/read_model_json.html","id":null,"dir":"Reference","previous_headings":"","what":"Read model definition from JSON — read_model_json","title":"Read model definition from JSON — read_model_json","text":"substitution escaped characters strings JSON file, converts list jsonlite::fromJSON()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/read_model_json.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read model definition from JSON — read_model_json","text":"","code":"read_model_json(path)"},{"path":"https://insightrx.github.io/PKPDsim/reference/read_model_json.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read model definition from JSON — read_model_json","text":"path Path JSON file","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/read_model_json.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read model definition from JSON — read_model_json","text":"List containing contents original JSON file","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/regimen_to_nm.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert PKPDsim regimen to NONMEM table (doses only) — regimen_to_nm","title":"Convert PKPDsim regimen to NONMEM table (doses only) — regimen_to_nm","text":"Convert PKPDsim regimen NONMEM table (doses )","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/regimen_to_nm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert PKPDsim regimen to NONMEM table (doses only) — regimen_to_nm","text":"","code":"regimen_to_nm( reg = NULL, dose_cmt = 1, n_ind = 1, t_obs = NULL, obs_cmt = 1, bioav = NULL )"},{"path":"https://insightrx.github.io/PKPDsim/reference/regimen_to_nm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert PKPDsim regimen to NONMEM table (doses only) — regimen_to_nm","text":"reg `PKPDsim` regimen, created using `new_regimen()` function dose_cmt dosing compartment, specified `reg` object n_ind repeat `n_ind` subjects t_obs add observation time(s) obs_cmt observation compartment added observation time(s) bioav bioavailability (numeric vector, can parameter)","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/regimen_to_nm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert PKPDsim regimen to NONMEM table (doses only) — regimen_to_nm","text":"Data frame containing doses","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/reparametrize.html","id":null,"dir":"Reference","previous_headings":"","what":"Reparametrize model parameters using a reparametrization defined within the model. — reparametrize","title":"Reparametrize model parameters using a reparametrization defined within the model. — reparametrize","text":"Mostly useful reparametrizing models standard parametrizations, e.g. NONMEM TRANS clinPK parametrizations.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/reparametrize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reparametrize model parameters using a reparametrization defined within the model. — reparametrize","text":"","code":"reparametrize(model, parameters, covariates)"},{"path":"https://insightrx.github.io/PKPDsim/reference/reparametrize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reparametrize model parameters using a reparametrization defined within the model. — reparametrize","text":"model PKPDsim model, compiled using `reparametrization` argument metadata object. parameters list model parameters covariates covariates list, specified PKPDsim covariates","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/reparametrize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reparametrize model parameters using a reparametrization defined within the model. — reparametrize","text":"Reparameterized model parameters","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/search_replace_in_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Find string and replace in file — search_replace_in_file","title":"Find string and replace in file — search_replace_in_file","text":"Find string replace file","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/search_replace_in_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find string and replace in file — search_replace_in_file","text":"","code":"search_replace_in_file(files = c(), find = NULL, replacement = NULL)"},{"path":"https://insightrx.github.io/PKPDsim/reference/search_replace_in_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find string and replace in file — search_replace_in_file","text":"files vector files find find string, vector character replacement replace , vector character, equal length `find`","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/search_replace_in_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find string and replace in file — search_replace_in_file","text":"Function return value edits files disk","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_regimen.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove n doses (from start) of PKPDsim regimen — shift_regimen","title":"Remove n doses (from start) of PKPDsim regimen — shift_regimen","text":"Opposite pop_regimen()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_regimen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove n doses (from start) of PKPDsim regimen — shift_regimen","text":"","code":"shift_regimen(regimen, n = 1, reset_time = TRUE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_regimen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove n doses (from start) of PKPDsim regimen — shift_regimen","text":"regimen PKPDsim regimen created using `new_regimen()` n number doses shift regimen reset_time reset remaining doses start t=0?","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_regimen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove n doses (from start) of PKPDsim regimen — shift_regimen","text":"Regimen selected number doses removed start","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_state_indices.html","id":null,"dir":"Reference","previous_headings":"","what":"R starts counting vector indices at 1, c++ starts at 0,\nso reduce all state numbers in the Cpp function definition by 1 — shift_state_indices","title":"R starts counting vector indices at 1, c++ starts at 0,\nso reduce all state numbers in the Cpp function definition by 1 — shift_state_indices","text":"R starts counting vector indices 1, c++ starts 0, reduce state numbers Cpp function definition 1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_state_indices.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"R starts counting vector indices at 1, c++ starts at 0,\nso reduce all state numbers in the Cpp function definition by 1 — shift_state_indices","text":"","code":"shift_state_indices(ode_def, n = -1)"},{"path":"https://insightrx.github.io/PKPDsim/reference/shift_state_indices.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"R starts counting vector indices at 1, c++ starts at 0,\nso reduce all state numbers in the Cpp function definition by 1 — shift_state_indices","text":"ode_def ODE definition n add/subtract number, default = -1","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate ODE or analytical equation — sim","title":"Simulate ODE or analytical equation — sim","text":"Simulates specified regimen using ODE system analytical equation","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate ODE or analytical equation — sim","text":"","code":"sim( ode = NULL, analytical = NULL, parameters = NULL, parameters_table = NULL, mixture_group = NULL, omega = NULL, omega_type = \"exponential\", res_var = NULL, iov_bins = NULL, seed = NULL, sequence = NULL, n_ind = 1, event_table = NULL, regimen = NULL, lagtime = NULL, covariates = NULL, covariates_table = NULL, covariates_implementation = list(), covariate_model = NULL, A_init = NULL, only_obs = FALSE, obs_step_size = NULL, int_step_size = 0.01, t_max = NULL, t_obs = NULL, t_tte = NULL, t_init = 0, obs_type = NULL, duplicate_t_obs = FALSE, extra_t_obs = TRUE, rtte = FALSE, checks = TRUE, verbose = FALSE, return_event_table = FALSE, return_design = FALSE, output_include = list(parameters = FALSE, covariates = FALSE), ... )"},{"path":"https://insightrx.github.io/PKPDsim/reference/sim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate ODE or analytical equation — sim","text":"ode function describing ODE system analytical string specifying analytical equation model use (similar ADVAN1-5 NONMEM). specified, use ODEs. parameters model parameters parameters_table dataframe parameters (parameters columns) containing parameter estimates individuals simulate. Formats accepted: data.frame, data.table, list lists. mixture_group mixture group models containing mixtures. either `1` `2`, since two groups currently allowed. omega vector describing lower-diagonal -subject variability matrix omega_type exponential normal, specified vector res_var residual variability. Expected list arguments `prop`, `add`, /`exp`. NULL default. iov_bins allow override default IOV bins model. Specified vector timepoints specifying bin separators, e.g. `iov_bins = c(0, 24, 48, 72, 9999)`. seed set seed reproducible results sequence NULL specifies pseudo-random sequence use, e.g. \"halton\" \"sobol\". See `mvrnorm2` details. n_ind number individuals simulate event_table use previously created `design` object used ODE simulation instead calling create_event_table() create new one. Especially useful repeated calling sim(), optimizations optimal design analysis. Also see `sim_core()` even faster simulations using precalculated `design` objects. regimen regimen object created using regimen() function lagtime either value (numeric) parameter (character) NULL. covariates list covariates (single individual) created using `new_covariate()` function covariates_table data.frame (unnamed list named lists per individual) covariate values covariates_implementation used `covariates_table`, named list covariate implementation methods per covariate, e.g. `list(WT = \"interpolate\", BIN = \"locf\")` covariate_model R code used pre-calculate effective parameters use ADVAN-style analytical equations. used ODE simulations. A_init vector initial state ODE system only_obs return observations obs_step_size step size observations int_step_size step size numerical integrator t_max maximum simulation time, specified pick end regimen maximum t_obs vector observation times, output values (used t_obs==NULL) t_tte vector observation times time--event simulation t_init initialization time first dose, default 0. obs_type vector observation types. valid combination equal length vector `t_obs`. duplicate_t_obs allow duplicate t_obs output? E.g. optimal design calculations t_obs = c(0,1,2,2,3). Default FALSE. extra_t_obs include extra t_obs output bolus doses? activated `t_obs` specified manually. E.g. bolus dose t=24, FALSE, PKPDsim output trough, bolus doses might want switch setting TRUE. set \"auto\" (default), TRUE default, switch FALSE whenever `t_obs` specified manually. rtte repeated events allowed (FALSE default) checks perform input checks? Default TRUE. calculations sim_ode invoked many times (e.g. population estimation, optimal design) makes sense switch FALSE (confirming input correct) improve speed. verbose show output return_event_table return event table simulation , run actual simulation. Useful iterative use sim(). return_design returns design (event table several details) simulation, run actual simulation. Useful iterative functions like estimation combination `sim_core()`, e.g. estimation optimal design. output_include list specifying include output table, keys `parameters` `covariates`. FALSE default. ... extra parameters","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate ODE or analytical equation — sim","text":"data frame compartments associated concentrations requested times Simulated regimen","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/sim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simulate ODE or analytical equation — sim","text":"","code":"# \\donttest{ p <- list( CL = 38.48, V = 7.4, Q = 7.844, V2 = 5.19, Q2 = 9.324, V3 = 111 ) omega <- c(0.3, # IIV CL 0.1, 0.3) # IIV V r1 <- new_regimen( amt = 100, times = c(0, 24, 36), type = \"infusion\" ) mod <- new_ode_model(\"pk_3cmt_iv\") dat <- sim( ode = mod, parameters = p, omega = omega, n_ind = 20, regimen = r1 ) # }"},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_core.html","id":null,"dir":"Reference","previous_headings":"","what":"Only core function of the simulation function, always just returns observations.\nMostly useful for estimations / optimal design. Has no checks (for speed)! — sim_core","title":"Only core function of the simulation function, always just returns observations.\nMostly useful for estimations / optimal design. Has no checks (for speed)! — sim_core","text":"core function simulation function, always just returns observations. Mostly useful estimations / optimal design. checks (speed)!","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_core.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Only core function of the simulation function, always just returns observations.\nMostly useful for estimations / optimal design. Has no checks (for speed)! — sim_core","text":"","code":"sim_core(sim_object = NULL, ode, duplicate_t_obs = FALSE, t_init = 0)"},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_core.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Only core function of the simulation function, always just returns observations.\nMostly useful for estimations / optimal design. Has no checks (for speed)! — sim_core","text":"sim_object list design simulation parameters ode ode duplicate_t_obs allow duplicate t_obs output? E.g. optimal design calculations t_obs = c(0,1,2,2,3). Default FALSE. t_init time initization ODE system. Usually 0.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_core.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Only core function of the simulation function, always just returns observations.\nMostly useful for estimations / optimal design. Has no checks (for speed)! — sim_core","text":"Data frame simulation results","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecated function, renamed to sim() — sim_ode","title":"Deprecated function, renamed to sim() — sim_ode","text":"Deprecated function, renamed sim()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecated function, renamed to sim() — sim_ode","text":"","code":"sim_ode(...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecated function, renamed to sim() — sim_ode","text":"... parameters passed sim() function","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deprecated function, renamed to sim() — sim_ode","text":"Output sim()","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode_shiny.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate ODE and create a Shiny app — sim_ode_shiny","title":"Simulate ODE and create a Shiny app — sim_ode_shiny","text":"function deprecated moved separate package https://github.com/ronkeizer/PKPDsimshiny.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode_shiny.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate ODE and create a Shiny app — sim_ode_shiny","text":"","code":"sim_ode_shiny(...)"},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode_shiny.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate ODE and create a Shiny app — sim_ode_shiny","text":"... arguments passed PKPDsimShiny::sim_ode_shiny()","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/sim_ode_shiny.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate ODE and create a Shiny app — sim_ode_shiny","text":"return value","code":""},{"path":[]},{"path":"https://insightrx.github.io/PKPDsim/reference/table_to_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a table to a list — table_to_list","title":"Convert a table to a list — table_to_list","text":"Convert table list","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/table_to_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a table to a list — table_to_list","text":"","code":"table_to_list(table)"},{"path":"https://insightrx.github.io/PKPDsim/reference/table_to_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a table to a list — table_to_list","text":"table data.frame","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/table_to_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert a table to a list — table_to_list","text":"List containing original table contents","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_model.html","id":null,"dir":"Reference","previous_headings":"","what":"Test a model — test_model","title":"Test a model — test_model","text":"Test model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_model.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test a model — test_model","text":"","code":"test_model(url, test_file, package, force = FALSE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/test_model.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Test a model — test_model","text":"url URL file path JSON representation model test_file Path .R file containing tests run package Package name force Run tests even model flagged building? Defaults FALSE","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_model.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Test a model — test_model","text":"Runs test file model return value","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_pointer.html","id":null,"dir":"Reference","previous_headings":"","what":"Test if model still in memory — test_pointer","title":"Test if model still in memory — test_pointer","text":"Test model still memory","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_pointer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test if model still in memory — test_pointer","text":"","code":"test_pointer(model)"},{"path":"https://insightrx.github.io/PKPDsim/reference/test_pointer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Test if model still in memory — test_pointer","text":"model pointer model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/test_pointer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Test if model still in memory — test_pointer","text":"return value","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/translate_ode.html","id":null,"dir":"Reference","previous_headings":"","what":"Translate a model from/to various PKPD simulators — translate_ode","title":"Translate a model from/to various PKPD simulators — translate_ode","text":"Currently supports PKDPsim <--> RxODE","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/translate_ode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Translate a model from/to various PKPD simulators — translate_ode","text":"","code":"translate_ode(code, auto = TRUE, from = NULL, to = NULL, verbose = TRUE)"},{"path":"https://insightrx.github.io/PKPDsim/reference/translate_ode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Translate a model from/to various PKPD simulators — translate_ode","text":"code character string ODE code auto auto-detect syntax (``) syntax syntax verbose verbose, `TRUE` `FALSE`","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/translate_ode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Translate a model from/to various PKPD simulators — translate_ode","text":"Translated PKPDsim RxODE model","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/triangle_to_full.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert triangle omega matrix to full omega matrix — triangle_to_full","title":"Convert triangle omega matrix to full omega matrix — triangle_to_full","text":"Convert triangle omega matrix full omega matrix","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/triangle_to_full.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert triangle omega matrix to full omega matrix — triangle_to_full","text":"","code":"triangle_to_full(vect)"},{"path":"https://insightrx.github.io/PKPDsim/reference/triangle_to_full.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert triangle omega matrix to full omega matrix — triangle_to_full","text":"vect vector specifying triangle omega matrix","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/triangle_to_full.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert triangle omega matrix to full omega matrix — triangle_to_full","text":"Omega matrix","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/vector_to_R_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Transform a vector into a string that evaluates to the same vector — vector_to_R_code","title":"Transform a vector into a string that evaluates to the same vector — vector_to_R_code","text":"Collapses vector comma-separated list strings quoted (special characters escaped). general purpose helper function writing new model code.","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/vector_to_R_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transform a vector into a string that evaluates to the same vector — vector_to_R_code","text":"","code":"vector_to_R_code(vec)"},{"path":"https://insightrx.github.io/PKPDsim/reference/vector_to_R_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transform a vector into a string that evaluates to the same vector — vector_to_R_code","text":"vec vector","code":""},{"path":"https://insightrx.github.io/PKPDsim/reference/vector_to_R_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Transform a vector into a string that evaluates to the same vector — vector_to_R_code","text":"character string length 1","code":""},{"path":"https://insightrx.github.io/PKPDsim/news/index.html","id":"pkpdsim-111","dir":"Changelog","previous_headings":"","what":"PKPDsim 1.1.1","title":"PKPDsim 1.1.1","text":"CRAN release: 2022-04-01 first version PKPDsim released CRAN. PKPDsim development since 2014, previous versions made available Github (InsightRX/PKPDsim).","code":""}]