// Don't do this anymore
$PARAM ETA1 = 0, ETA2 = 0mapbayr contains a library of example model files (.cpp), accessible with exmodel(). You are invited to perform MAP-Bayesian estimation with your own models. These model files should be follow some specifications in order to be “read” by mapbayr.
$PARAM blockFrom mapbayr version 1.0.0, it is not needed to define ETAs in $PARAM anymore. If ETA1, ETA2 etc… are found in $PARAM, an error will be returned.
// Don't do this anymore
$PARAM ETA1 = 0, ETA2 = 0@covariates tag to record covariates in the $PARAM block. Otherwise, you will not be allowed to pass a dataset with covariates columns.// Do this
$PARAM @covariates
BW = 70, SEX = 0
// Better
$PARAM @annotated @covariates
BW : 70 : Body weight (kg)
SEX : 0 : Sex (0=Male, 1=Female)
// Don't do this
$PARAM BW = 70, SEX = 0$CMT block@annotated tag must be used to record compartments.obs_rows() to fill the ‘cmt’ column in your dataset.mapbayest() function. The information is mandatory if you use adm_rows() to build your dataset in order to automatically set the value of the ‘cmt’ column. Especially useful if you use a model with an absorption from several depot compartment requiring to duplicate administrations lines in the data set.//example: model with dual zero and first order absorption in compartment 1 & 2, respectively, and observation of parent drug + metabolite
$CMT @annotated
DEPOT: Depot [ADM]
CENT_PAR: examplinib central [ADM, OBS]
PERIPH : examplinib peripheral
CENT_MET : methylexamplinib central [OBS] $OMEGA blockDefine at least one $OMEGA block.
$OMEGA 0.123 0.456 0.789Multiple blocks and all the options (e.g. correlation, block etc) are allowed.
$OMEGA @annotated
ECL : 0.123 : Clearance
ETA2 : 0.456 : Volume of distribution
FOO : 0.789 : Absorption rate constant
// reminder: Each ETA can be described with (`@annotated`)
// The labels (on the left-hand side) are not considered by mapbayr$SIGMA blockThe definition of the $SIGMA block may not be as straightforward as other blocks, but we tried to keep it as simple as possible. Keep in mind that mapbayr always expect a pair of sigma values for each type of dependent variable: the first value for proportional error, the second for additive.
Two situations can be distinguished:
$CMT.Simply write one pair of sigma values to describe proportional and additive error on your concentrations. This error model will be automatically applied to the compartment where observations were recorded in your dataset (i.e. value of CMT when MDV = 0).
$SIGMA 0.111 0 // proportional error $SIGMA 0 0.222 // (log) additive error$SIGMA 0.333 0.444 // mixed error$CMT.Write as many pairs of sigma values as there are compartments assigned with [OBS] in $CMT. The order of the pair must respect the order in which compartments were assigned. To put it more clearly, the sigma matrix will be interpreted as such whatever the model :
| N° in the SIGMA matrix diagonal | Associated error |
|---|---|
| 1 | Proportional on concentrations in the 1st cmt with [OBS] |
| 2 | Additive on concentrations in the 1st cmt with [OBS] |
| 3 | Proportional on concentrations in the 2nd cmt with [OBS] |
| 4 | Additive on concentrations in the 2nd cmt with [OBS] |
//example: correlated proportional error between parent and metabolite
$SIGMA @block
0.050 // proportional error on parent drug
0.000 0.000 // additive error on parent drug
0.100 0.000 0.200 // proportional error on metabolite
0.000 0.000 0.000 0.000 // additive error on metabolite
// reminder: sigma values can be recorded in multiple $SIGMA blocks$TABLE block or $ERROR blockDV. Mind the code, especially if concentrations are observed in multiple compartments.$TABLE
double DV = (CENTRAL / VC) * exp(EPS(2)) ;$TABLE
double PAR = (CENT_PAR / V) * (1 + EPS(1)) ;
double MET = (CENT_MET / V) * (1 + EPS(3)) ;
double DV = PAR ;
if(self.cmt == 4) DV = MET ;
// reminder: use "self.cmt" to internaly refer to a compartment in a mrgsolve model code. Note that mapbayr does not strictly rely on this $ERROR block to define the residual error internally and compute the objective function value, but on information passed in the $SIGMA block. However, we strongly advise you to properly code your $ERROR block with EPS(1), EPS(2) etc…, if only to use your code as a regular mrgsolve model code and simulate random effects.
$MAIN blockFrom mapbayr version 1.0.0, it is not needed to duplicate expressions with ETAs in $MAIN anymore.
// Do this (as usual)
$MAIN
double CL = TVCL * exp(ETA(1)) ;
// Don't do this anymore
MAIN
double CL = TVCL * exp(ETA1 + ETA(1)) ;$CAPTURE blockmapbayest() anyway)mapbayest() anyway)$CAPTURE DV PAR MET CL