Torsten

Version 0.89.0

A pharmacokinetics/pharmacodynamics library for Stan

Using Torsten

The reader should have a basic understanding of how Stan works. In this section we go through the different functions Torsten adds to Stan. The code for the examples can be found at Torsten’s example models.

0.1 Events specification

Torsten’s functions are prefixed with pmx_. For some of their arguments we adopt NM-TRAN format for events specification(Table 1).

Table 1: NM-TRAN compatible event specification arguments. All arrays should have the same length corresponding to the number of events.
Argument Name Definition Stan data type
time event time real[]
amt dosing amount real[]
rate infusion rate real[]
ii interdose interval real[]
evid event ID int[]
cmt event compartment int[]
addl additionial identical doses int[]
ss steady-state dosing flag int[]

All the real[] arguments above are allowed to be parameters in a Stan model. In addtion, Torsten functions support optional arguments and overloaded signatures. Optional arguments are indicated by surrounding square bracket []. Table below shows three commonly used PMX model arguments that support overloading. In the rest of this document we assume this convention unless indicated otherwise.

Table 2: PMX model parameter overloadings. One can use 1d array real[] to indicate constants of all events, or 2d array real[ , ] so that the \(i\)th row of the array describes the model arguments for time interval \((t_{i-1}, t_i)\), and the number of the rows equals to the size of time.
Argument Name Definition Stan data type Optional
theta model parameters real[] or real[ , ] N
biovar bioavailability fraction real[] or real[ , ] Y (default to 1.0)
tlag lag time real[] or real[ , ] Y (default to 0.0)
Last updated on 30 Jun 2021
Published on 25 Jun 2021
 Edit on GitHub