# Tools for Performing Pharmacokinetic-Pharmacodynamic Simulations

## Documentation for package ‘PKPDsim’ version 1.1.1

- DESCRIPTION file.

## Help Pages

PKPDsim-package | PKPDsim package
add_quotes | Put vector values in quotes
add_ruv | Add residual variability to the dependent variable
add_ruv_to_quantile | Calculate the increase in a specific quantile for a distribution on y when residual variability is added
adherence_binomial | Binomial adherence
adherence_markov | Markov adherence model
advan | ADVAN-style functions to calculate linear PK systems
advan_create_data | Create ADVAN-style dataset
advan_parse_output | Internal function to parse the raw output from ADVAN-style functions
advan_process_infusion_doses | Add column RATEALL to ADVAN-style dataset to handle infusions
analytical_eqn_wrapper | Wrapper for using analytical equations with PKPD regimens
apply_lagtime | Apply lagtime to a regimen
bioavailability_to_R_code | Transforms bioavailability specs into appropriate R code
calculate_parameters | Calculate model-specific variables using a dummy call to sim_ode()
calc_dydP | Calculate derivative
calc_ss_analytic | Returns the state of a linear PK system at steady state (trough) using analytics equations (so for linear PK systems only).
check_iov_specification | Checks that IOV was specified appropriately
check_mixture_model | Check that mixture model is specified in right format and within constraints (1 parameter, 2 groups)
compile_sim_cpp | Compile ODE model to c++ function
covariates_table_to_list | Convert covariate table specified as data.frame
covariate_last_obs_only | Use only last observed covariate values
create_event_table | Create an event table
create_obs_data | Create obs data
cv_to_omega | Create lower-diagonal omega matrix from CV for parameter estimates
define_tdm_init_model | defines C code for TDM before dose conditions
detect_ode_syntax | Auto-detect the syntax for the ODE code
f_cov | covariate function builder
get_ode_model_size | Get the number of states in the ODE from the code code C++ code for model
get_parameters_from_code | Get model parameters from code
get_t_obs_from_regimen | Extract sensible default observation times from a specified regimen
get_var_y | Get expected variance/sd/ci of dependent variable based on PKPDsim model, parameters, and regimen
ifelse0 | ifelse function but then based on whether value is NULL or not
is_newer_package | Check if package number is different from currently installed, and provide some messaging.
is_positive_definite | Is matrix positive definite
join_cov_and_par | Combines covariates and parameters into a single list, useful for reparametrization of the model.
join_regimen | Join two dosing regimens
merge_regimen | Merge two regimens together.
model_from_api | Load model definition from API, and compile to R library
model_library | Model library
mvrnorm2 | More powerful multivariate normal sampling function
na_locf | Fill in NAs with the previous non-missing value
new_adherence | Probabilistically model adherence
new_covariate | New covariate
new_covariate_model | covariate model function
new_ode_model | Create new ODE model
new_regimen | Dose regimen for sim_ode
nlmixr_parse_parameters | Function to parse parameters for a model into a structure used by nlmixr
nm_to_regimen | Create a regimen from NONMEM data
now_utc | Current time in UTC
OneCompIVbolus | ADVAN-style equations
OneCompIVinfusion | IV infusion- 1 compartment
OneCompOral | first-order absorption 1 compartment
parse_obs_types | Parse observation types to simulation code
pkdata | PK dataset
pkpdsim_to_nlmixr | Convert a model generated with PKPDsim to an object for nlmixr
pop_regimen | Remove n doses (from tail) of PKPDsim regimen
print.covariate | Print function for PKPDsim covariate object
print.PKPDsim | Print function for PKPDsim simulation function
print.regimen | Print function for PKPDsim regimen
print_list | Return a list in R syntax
read_model_json | Read model definition from JSON
regimen_to_nm | Convert PKPDsim regimen to NONMEM table (doses only)
reparametrize | Reparametrize model parameters using a reparametrization defined within the model.
search_replace_in_file | Find string and replace in file
shift_regimen | Remove n doses (from start) of PKPDsim regimen
shift_state_indices | R starts counting vector indices at 1, c++ starts at 0, so reduce all state numbers in the Cpp function definition by 1
sim | Simulate ODE or analytical equation
sim_core | Only core function of the simulation function, always just returns observations. Mostly useful for estimations / optimal design. Has no checks (for speed)!
sim_ode | Deprecated function, renamed to 'sim()'
sim_ode_shiny | Simulate ODE and create a Shiny app
table_to_list | Convert a table to a list
test_model | Test a model
test_pointer | Test if model still in memory
ThreeCompIVbolus | IV bolus- 3 compartment
ThreeCompIVinfusion | IV infusion- 3 compartment
ThreeCompIVinfusionMetab | 3-compartment IV infusion with first-order metabolite formation
ThreeCompOral | first-order absorption- 3 compartment
ThreeCompOralMetab | first-order absorption- 3 compartment-Metabolite
translate_ode | Translate a model from/to various PKPD simulators
triangle_to_full | Convert triangle omega matrix to full omega matrix
TwoCompIVbolus | IV bolus- 2 compartment
TwoCompIVinfusion | IV infusion- 2 compartment
TwoCompOral | First-order absorption- 2 compartment
vector_to_R_code | Transform a vector into a string that evaluates to the same vector