Learn R Programming

⚠️There's a newer version (1.5.2) of this package.Take me there.

mrgsolve (version 0.8.10)

Simulate from ODE-Based Population PK/PD and Systems Pharmacology Models

Description

Facilitates simulation from hierarchical, ordinary differential equation (ODE) based models typically employed in drug development. A model specification file is created consisting of R and C++ code that is parsed, compiled, and dynamically loaded into the R session. Input data are passed in and simulated data are returned as R objects. A dosing event engine allows interventions (bolus and infusion) to be managed separately from the model code. Differential equations are solved with the 'DLSODA' routine in 'ODEPACK' ().

Copy Link

Version

Install

install.packages('mrgsolve')

Monthly Downloads

1,043

Version

0.8.10

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Kyle T Baron

Last Published

November 1st, 2017

Functions in mrgsolve (0.8.10)

BLOCK_PARSE

Functions to parse code blocks.
Req

Request simulated output.
aboutsolver

About the ODEPACK differential equation solver used by mrgsolve.
cmtn

Get the compartment number from a compartment name.
code

Extract the code from a model.
ev-class

S4 events class
ev_assign

Replicate a list of events into a data set.
ev_seq

Schedule a series of event objects
events

Event objects for simulating PK and other interventions.
mcRNG

Set RNG to use L'Ecuyer-CMRG.
mcode_cache

Write, compile, and load model code.
PKMODEL

Parse PKMODEL BLOCK data.
chain

Functions for chaining commands together.
ev_days

Schedule dosing events on days of the week.
ev_ops

Operations for ev objects.
idata_set

Select and modify a idata set for simulation.
init

Methods for working with the model compartment list.
lower2matrix

Create a square numeric matrix from the lower-triangular elements.
matlist-class

S4 class matlist.
modlib

Internal model library.
modlib_details

modlib: PK/PD Model parameters, compartments, and output variables.
mrgsim

Simulate from a model object.
mrgsims-class

S4 class for mrgsolve simulation output.
numericlist-class

S4 class numeric list.
modlib_pk

modlib: Pharmacokinetic models.
cmt_list-class

S4 cmt_list class
modlib_pkpd

modlib: Pharmacokinetic / pharmacodynamic models.
mrgsolve_example

Extract example model from system library
mrgsolve

mrgsolve
numericlist

Methods for numericlist.
rename_cols

rename columns from vector for new names
render

Render a model to a document.
scrape_and_call

Scrape options and pass to function.
scrape_opts

Scrape options from a code block.
stime

Get the times at which the model will be evaluated.
stime,mrgmod-method

Create a simtime object.
omega

Manipulate OMEGA matrices.
$,mrgmod-method

Create and work with parameter objects.
qsim

A quick simulation function.
realize_addl

Make addl doses explicit in an event object or data set.
simargs

Access or clear arguments for calls to mrgsim.
bmat

Create matrices from vector input.
cama

Run the model cama function.
soloc

Return the location of the model shared object.
valid_data

Validate and prepare data sets for simulation.
%>%

Forward pipe.
blocks

Return the code blocks from a model specification file.
carry_out

Select items to carry into simulated output.
ev_rep

Replicate an event object
ev_repeat

Repeat a block of dosing events
inventory

Check whether all required parameters needed in a model are present in an object
is.mrgmod

Check if an object is a model object.
matlist

Methods for working with matrix-list objects.
c,matlist-method

Operations with matlist objects.
merge.list

Merge two lists.
mod

Return the model object.
mread_cache

Read a model specification file.
mrgmod-class

S4 class for mrgsolve model object.
as_data_set

Create a simulatinon data set from ev objects.
as_deslist

Create a list of designs from a data frame.
design

Set observation designs for the simulation.
details

Extract model details.
env_eval

Re-evaluate the code in the ENV block.
mrgsolve_template

Create model specification file from template
mvgauss

Simulate from a multivariate normal distribution with mean zero.
plot,batch_mrgsims,missing-method

Plot method for mrgsims objects.
as.list,mrgmod-method

Coerce a model object to list.
as_bmat

Coerce R objects to block or diagonal matrices.
cvec

Create create character vectors.
data_set

Select and modify a data set for simulation.
env_get

Return model environment.
exdatasets

Example input data sets.
expand.idata

Create template data sets for simulation.
is.mrgsims

Check if an object is mrgsim output.
knobs

Run sensitivity analysis on model settings.
modlib_tmdd

modlib: Target mediated disposition model.
modlib_viral

modlib: HCV viral dynamics models.
modlist-class

S4 class matlist.
plot_mrgsims

Generate a quick plot of simulated data.
reserved

Reserved words.
revar

Get model random effect variances and covariances.
tscale

Rescale time in the simulated output.
update

Get all names from a model object.
modlist

Create a modlist object.
obsaug

Augment observations in the simulated output.
obsonly

Collect only observations in the simulated output.
parameter_list-class

S4 parameter_list class
pkmodel

Simulate from 1- or 2-compartment PK model.
env_ls

List objects in the model environment.
env_update

Update objects in model environment.
file_show

Show model specification and C++ files.
see

Print model code to the console.
show,modlist-method

Show a modlist object.
c,tgrid-method

Operations with tgrid objects.
touch_funs

Get inits from compiled function.
house

Return a pre-compiled, PK/PD model.
lctran

Convert select upper case column names to lower case to conform to mrgsolve data expectations.
loadso

Load the model shared object.
modMATRIX

Create a matrix.
modelparse

Parse model specification text.
mrgsims

Methods for working with mrgsims objects.
mrgsims_dplyr

Methods for handling output with dplyr verbs.
nmxml

Get THETA, OMEGA and SIGMA from a completed NONMEM run
numeric2diag

Create a diagonal numeric matrix from diagonal elements.
recmatrix

Create a matrix of events for simulation.
relocate

Update model or project in an model object.
show,mrgmod-method

Print model details.
sigma

Manipulate SIGMA matrices.