**Objectives:** learn how to use the Monolix libraries of models and use your own models.

**Projects:** theophylline_project, PDsim_project, warfarinPK_project, TMDD_project, LungCancer_project, hcv_project

For the definition of the structural model, the user can either select a model from the available model libraries or write a model itself using the Mlxtran language.

## Model libraries

Six different model libraries are available in Monolix, which we will detail below. To use a model from the libraries, in the `Structural model`

tab, click on `Load from library`

and select the desired library. A list of model files appear, as well as a menu to filter them. Use the filters and indications in the file name (parameters names) to select the model file you need.

The model files are simply text files that contain pre-written models in Mlxtran language. Once selected, the model appears in the Monolix GUI. Below we show the content of the (ka,V,Cl) model:

### The PK library

**theophylline_project**(data = ‘theophylline_data.txt’ , model=’lib:oral1_1cpt_kaVCl.txt’)

The PK library includes model with different administration routes (bolus, infusion, first-order absorption, zero-order absorption, with or without Tlag), different number of compartments (1, 2 or 3 compartments), and different types of eliminations (linear or Michaelis-Menten). More details, including the full equations of each model, can be found on the dedicated page for the model libraries.

The PK library models can be used with single or multiple doses data, but they allow one type of administration in the data set (only oral or only bolus, but not some individuals with bolus and some with oral for instance). If a model for several types of administrations is needed, see below “Using my own model”.

### The PD library

**PDsim_project**(data = ‘PDsim_data.txt’ , model=’lib:immed_Emax_const.txt’)

The PD model library contains direct response models such as Emax and Imax with various baseline models, and turnover response models. These models are PD models only and the drug concentration over time must be defined in the data set and passed as a regressor. The logic of the file names and the full equations are described on the PK/PD model library webpage.

### The PKPD library

**warfarinPKPD_project**(data = ‘warfarin_data.txt’, model = ‘lib:oral1_1cpt_IndirectModelInhibitionKin_TlagkaVClR0koutImaxIC50.txt’)

The PKPD library contains joint PKPD models, which correspond to the combination of the models from the PK and from the PD library. These models contain two outputs, and thus require the definition of two observation identifiers (i.e two different values in the OBSERVATION ID column).

### The TMDD library

**TMDD_project**(data = ‘TMDD_dataset.csv’ , model=’lib:bolus_2cpt_MM_VVmKmClQV2_outputL.txt’)

The TMDD library contains various models for molecules displaying target-mediated drug disposition (TMDD). It includes models with different administration routes (bolus, infusion, first-order absorption, zero-order absorption, bolus + first-order absorption, with or without Tlag), different number of compartments (1, or 2 compartments), different types of TMDD models (full model, MM approximation, QE/QSS approximation, etc), and different types of output (free ligand or total free+bound ligand). More details about the library and guidelines to choose model can be found on the dedicated TMDD documentation page.

### The TTE library

**LungCancer_project**(data = ‘lung_cancer_survival.csv’ , model=’lib:gompertz_model_singleEvent.txt’)

The TTE library contains typical parametric models for time-to-event (TTE) data. TTE models are defined via the hazard function, in the library we provide exponential, Weibull, log-logistic, uniform, Gompertz, gamma and generalized gamma models, for data with single (e.g death) and multiple events (e.g seizure) per individual. More details and modeling guidelines can be found on the TTE dedicated webpage, along with case studies.

### Step-by-step example with the PK library

**theophylline_project**(data = ‘theophylline_data.txt’ , model=’lib:oral1_1cpt_kaVCl.txt’)

We would like to set up a one compartment PK model with first order absorption and linear elimination for the theophylline data set. We start by creating a new Monolix project. Next, the the `Data`

tab, we click browse, and select the theophylline data set (which can be downloaded from the data set documentation webpage). In this examples, all columns are already automatically tagged, based on the header names. We click `ACCEPT`

and `NEXT`

and arrive on the `Structural model`

tab, click on `LOAD FROM LIBRARY`

to choose a model from the Monolix libraries. The menu at the top permit to filter the list of models: after selecting an oarl/extravascular administration, no delay, first-order absorption, one compartment and a linear elimination, two models remain in the list (ka,V,Cl) and (ka,V,k). Click on the `oral1_1cpt_kaVCl.txt`

file to select it.

After this step, the GUI moves to the `Initial Estimates`

tab, but it is possible to go back to the `Structural model`

tab to see the content of the file:

[LONGITUDINAL] input = {ka, V, Cl} EQUATION: Cc = pkmodel(ka, V, Cl) OUTPUT: output = Cc

Back to the `Initial Estimates`

tab, the initial values of the population parameters can be adjusted by comparing the model prediction using the chosen population parameters and the individual data. Click on `SET AS INITIAL VALUES`

when you are done.

In the next tab, the `Statistical model & Tasks`

tab, we propose by default:

- A combined error observation model
- Lognormal distributions for all parameters (ka, V and Cl)

At this stage, the monolix project should be saved. This creates a human readable text file with extension .mlxtran, which contains all the information defined via the GUI. In particular, the name of the model appears in the section `[LONGITUDINAL]`

of the saved project file:

<MODEL> [INDIVIDUAL] input = {ka_pop, omega_ka, V_pop, omega_V, Cl_pop, omega_Cl} DEFINITION: ka = {distribution=lognormal, typical=ka_pop, sd=omega_ka} V = {distribution=lognormal, typical=V_pop, sd=omega_V} Cl = {distribution=lognormal, typical=Cl_pop, sd=omega_Cl} [LONGITUDINAL] input = {a, b} file = 'lib:oral1_1cpt_kaVCl.txt' DEFINITION: CONC = {distribution=normal, prediction=Cc, errorModel=combined1(a,b)}

## Use your own model

If the models present in the libraries do not suit your needs, you can write a model yourself. You can either start completely from scratch or adapt a model existing in the libraries. In both cases, the syntax of the Mlxtran language is detailed on the mlxtran webpage. You can also copy-paste models from the mlxtran model example page.

### Writing a model from scratch

**8.case_studies/hcv_project**(data = ‘hcv_data.txt’ , model=’hcvNeumann98_model.txt’)

In the `Structural model`

tab, you can click on `New model`

to open the mlxEditor, and start writing your own model. When you are done, save your model file as .txt file, close the editor and use the `Browse`

button of Monolix to find and select your new model file.

You can even create your own library of models. An example of a basic library which includes several viral kinetics model is available in the demos `8.case_studies/model`.

### Modifying a model from the libraries

Load an existing model using the `Load from library`

button, and then click on `Open in editor`

to open the model file in the MlxEditor. There you can adapt the model, for instance to add a PD model. Be careful to save the new model under a new name, to avoid overwriting the library files.