Laboratory of Applied Pharmacokinetics and Bioinformatics Optimizing drug therapy for populations and individuals |
The Pmetrics model file is a text file with 9 blocks, each marked by "#" followed by a header tag.
For each header, only the capital letters are required for recognition by Pmetrics. The blocks can be in any order, and header names are case-insensitive (i.e. the capitalization here is just to show which letters are required). Fortran is also case-insensitive, so in variable names and expressions case is ignored.
#Pri
KE, 0, 5
V, 0.01, 100
KA, 0, 5
KCP
KPC, 0, 5
Tlag1, 0, 3
IC3, 100
FA1, 0, 1
Note that in this example, all variables have ranges except IC3, which will be fixed at a value of 100.
#Cov
wt
cyp
IC!
#Sec
CL = Ke * V * wt**0.75
+IF(cyp .GT. 1) CL = CL * cyp
#Bol
NBCOMP(1) = 2
#Ini
X(2) = IC*V (i.e. IC is a covariate with the measured trough concentration prior to an observed dose)
X(3) = IC3 (i.e. IC3 is a fitted amount
in this unobserved compartment)
#F
FA(1) = FA1
#Lag
TLAG(1) = Tlag1
#Dif
XP(1) = -KA*X(1)
XP(2) = RATEIV(1) + KA*X(1) - (KE+KCP)*X(2) + KPC*X(3)
XP(3) = KCP*X(2) - KPC*X(3)
#Out
Y(1) = X(2)/V
This block contains all the information Pmetrics requires for the structure of the error model. In Pmetrics, each observation is weighted by 1/error^2. There are two choices for the error term: error = SD * gamma error = (SD^2 + lamda^2)^0.5 (Note that lambda is only available in NPAG currently). where SD is the standard deviation (SD) of each observation [obs], and gamma and lambda are terms to capture extra process noise related to the observation, including mis-specified dosing and observation times. SD is modeled by a polynomial equation with up to four terms: C0 + C1*[obs] + C2*[obs]^2 + C3*[obs]^3. The values for the coefficients should ideally come from the analytic lab in the form of inter-run standard deviations or coefficients of variation at standard concentrations. You can use the Pmetrics function PMerrorPoly() to choose the best set of coefficients that fit the data from the laboratory. Alternatively, if you have no information about the assay, you can use the Pmetrics function ERRrun() to estimate the coefficients from the data. Finally, you can use a generic set of coefficients. We recommend that as a start, C0 be set to half of the lowest concentration in the dataset and C1 be set to 0.15. C2 and C3 can be 0. In the multiplicative model, gamma is a scalar on SD. In general, well-designed and executed studies will have data with gamma values approaching 1. Poor quality, noisy data will result in gammas of 5 or more. Lambda is an additive model to capture process noise, rather than the multiplicative gamma model. We tend to prefer lambda.
To specify the model in this block, the first line needs to be either L=[number] or G=[number] for a lambda or gamma error model. The [number] term is the starting value for lambda or gamma. Good starting values for lambda are 1 times C0 for good quality data, 3 times C0 for medium, and 5 or 10 times C0 for poor quality. Note, that C0 should generally not be 0, as it represents machine noise (e.g. HPLC or mass spectrometer) that is always present. For gamma, good starting values are 1 for high-quality data, 3 for medium, and 5 or 10 for poor quality. If you include an exclamation point (!) in the declaration, then lambda or gamma will be fixed and not estimated. Note that you can only fix lambda currently to zero. The next line(s) contain the values for C0, C1, C2, and C3, separated by commas. There should be one line of coefficients for each output equation. By default Pmetrics will use values for these coefficients found in the data file. If none are present or if the model declaration line contains an exclamation point (!) the values here will be used.
#Err
L=0.4
0.1,0.1,0,0
#Err
G=2!
0.1,0.1,0,0
0.3,0.1,0,0!
This block is for advanced Fortran programmers only. Occasionally, for very complex models, additional Fortran subroutines are required. They can be placed here. The code must specify complete Fortran subroutines which can be called from other blocks with appropriate call functions.
Reserved Variable | Function in Pmetrics |
---|---|
ndim | internal |
t | time |
x | array of compartment amounts |
xp | array of first derivative of compartment amounts |
rpar | internal |
ipar | internal |
p | array of primary parameters |
r | input rates |
b | input boluses |
npl | internal |
numeqt | output equation number |
ndrug | input number |
nadd | covariate number |
rateiv | intravenous input for inputs when DUR>0 in data files |
cv | covariate values array |
n | number of compartments |
nd | internal |
ni | internal |
nup | internal |
nuic | internal |
np | number of primary parameters |
nbcomp | bolus compartment array |
psym | names of primary parameters |
fa | biovailability |
tlag | lag time |
tin | internal |
tout | internal |
#Pri
KE
V0
KA
Tlag1
#Cov
wt
#Sec
V = V0*wt
#Lag
TLAG(1) = Tlag1
#Out
Y(1) = X(2)/V
#Err
L=0.1
0.1,0.1,0,0