Home PK intro R NONMEM Calculators Data checker

Subjects

Create datasets Code snippets & templates Pirana & PsN

NONMEM


Items



Introduction
NONMEM [Nonlinear Mixed Effects Modelling] is model analysis software used for fitting and simulation data. It is a powerful tool which can be used in the analyses of population pharmaokinetic (PK) and pharmacodynamic (PD) data. It is often used in combination with the subroutine package PREDPP. The latter has standard PKPD models ready to use. User defined models are possible when the standard models do not suffice.

NONMEM is written in FORTRAN a programming language with exact sciences in mind. NONMEM is often used in combination with other software.

  • Fortran compiler (to handle FORTRAN language)
  • NONMEM application and license
  • Perl to handle Perl language for the use of PsN.
  • Perl-speaks-NONMEM (PsN) a collection of Perl modules facilitating the development of models in NONMEM.
  • Pirana a graphical user interface (GUI) combining NONMEM, PsN and R in a user friendly interface.
  • R and Rstudio a program for statistical computing and graphics
  • Text editor like notepad++ Any code editor

Workflow
After a succesful installation of all the required software and setting up the connections, one can start with the PKPD analysis. Most analysis and model development follows a specific workflow:

  1. Evaluating and checking the data; is the data complete, realistic values, how does it look (trends, clusters, etc).
  2. NONMEM compatible database; NONMEM requires a specific format of the database and mandatory elements. See: create a NONMEM dataset.
  3. NONMEM model; The models are defined in a model file which includes connecting with the database, relations, PK parameters, error models, covariates, etc. Refer to NONMEM models
  4. Evaluating and comparing different models; Which model describes the data best and is stable/robust.
  5. Covariate analysis; Test covariates for their effects on the PK parameters and the model in general.
  6. Validation of the model; Test the validity and robustness of the model e.g. using bootstraps.


Literature

Basic concepts: Covariates: VPC: Diagnostics & validation: Shrinkage: LOQ data (M3 method):


ADVAN TRANS

Information on closed form ADVAN and TRANS subroutines
From NONMEM guide V




NONMEM errors

voor Maaike

Run crashes:

If a run terminates prematurely, you can find information in the nonmem list file (runnmumber.lst) that is generated. However, if it terminates at the start a list file is not generated in the working directory yet. In this case you can find it in the responding 'modelfit_dir' folder (most likely the last one) and than 'NM_run1' folder (psn.lst). [only with psn?] Most commonly errors in dataset or coding errors


Minimization terminated:

Abnormal termination of the estimation step. Could be due to several reasons. Note if termination is successful, it is still possible that the estimation step did not run correctly (zero gradients and final estimates same as initial estimates).


"DUE TO ROUNDING ERRORS (ERROR=134)"

This is due to the requested number of significant digits. In this case the requested number is higher than the significant digits obtained in one or multiple of the parameters being estimated. Check gradients which parameter goes below the requested number of significant digits (default NSIG=3). If the parameter estimates are reasonable, it might be accepted. Possible to change the number of significant digits in $EST like NSIG, SIGL, SIGLO, TOL. If SIGLO is not specified it equals SIGL. [Refer to NONMEM guide V I.20] SIGLO <= TOL SIGL <= SIGLO NSIG <= SIGL/3


NONMEM keeps iterating

There is little change in the OFV even with SIGL/TOL adjusted. Parameter doesn't settle down at less than NSIG if contribution to objective function is very small. Set CTYPE=4 in $EST as alternative convergence test. It will test if objective function has not changed by more than NSIG significant digits beyond the decimal point over 10 iterations. If this is satisfied it will terminate successfully. [NONMEM guide introduction to NM 7.4.4 I.22]


Numeric difficulties in PREDPP

Set proper constraints, change initial estimates, make sure no log zero etc.


R matrix algorithmically non-positive semidefinite

Error in covariance step. The apparent minimum of the gradient field is a saddle point. Possibly not the global minimum. It is possible to use SADDLE_RESET=1 which resets You may need higher SIGL and TOL in $COV than in the $EST step to avoid positive definiteness issues. The R matrix can be preconditioned and/or forced positive using options as FPOSDEF=1, PRECOND=n etc.