Hi everybody out there doing pharmacometrics,
I have been writing some free model estimation software as a side project. It wont be a big professional thing like NONMEM, nlmixr2, or Monolix. This has been brewing for a number of years and might be starting to get ready for broader use. I'd like feedback on what people like/dislike with the control, data, and table file structures. It somewhat resembles NONMEM due to practical reasons but it is written in C instead of FORTRAN.
I made some examples but I dont really know if its practical right now or if further development is needed. People can let me know what are some essential features that might be needed. Suggestions are welcome but I cant promise that I will (or that I'm smart enough to) implement them.
It allows multi-threaded estimation, and doesnt share code with any other projects except for the open-source BOBYQA algorithm and needling linking to GSL. Right now it only compiles with gcc.
Douglas Eleveld
OpenPMX is a collection of numerical routines for estimation and simulation of mixed-effect pharmacokinetic and pharmacodynamic models.
If you just want to use the latest stable version then you should look at the Releases. This repository contains the work-in-progress (WIP) development version and could concievably be broken.
- First-order conditional estimation with interation (FOCEI) results similar to industry standard NONMEM
- Code and simulate/estimate models using text files and C allows scripting and integration with other tools
- System advancers for:
- Analytic models for common comparmental models
- Ordinary-Differential-Equation (ODE) solver for complex models
- Eigensystem solver for linear models of any topology
- Utilize multi-core CPUs via OpenMP or pthreads
- Estimation speed comparable with NONMEM
- Limited project scope and complexity, focused on simulation and estimation
- Few dependencies: gcc, GSL
- Added an initial LAPLACE method the stage1.c, still testing to see if any performance is gained. Based on code submitted by Erik Olofsen (e.olofsen@weggetjes.nl).
- Documentation of the FOCEI method derived from code and documentation submitted by Erik Olofsen (e.olofsen@weggetjes.nl)
- Speed optimized advance functions for two- and three-compartment models and eigensystem solver.
- Covariance matrix of estimation via
covariance()to determine parameter limits.- For a given change in objective function value, the upper and lower bounds of the estimated
THETA(),SIGMA(), andOMEGA()diagonal values are calculated - The default uses the Sandwitch matrix (R-1SR-1)
- The near-null space of S and R are examined to determine non-idenifiable parameters
- For a given change in objective function value, the upper and lower bounds of the estimated
- Likelihood profiles via
profile()to determine parameter limits. Uses bracketing to find the paramater value for a delta objective function to a desired accuracy. - Use BLQ estimates in model estimation using the
loglik_llq()function within the$PRED()record - Simulate Target-Controlled-Infusion (TCI) dosing on any model
- Reload population models via
reload()from previous (even incomplete) estimations
- PAGE meeing 2026 as a Software Demonstration. The abstract and poster are available.
OpenPMX is free software, you can redistribute it and/or modify it under the terms of the GNU General Public License. Unlike the licenses of proprietary pharmacometric software the license of OpenPMX does not restrict scientific cooperation. It allows you to share your programs freely with others. The GNU General Public License does not permit this software to be redistributed in proprietary programs.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- Ubuntu:
- Install GSL with
sudo apt-get install libgsl-dev
- Install GSL with
- Windows MSYS2:
- Windows WSL:
- Install compiler and linker with
sudo apt-get install build-essentials - Install GSL, with
sudo apt-get install libgsl-dev
- Install compiler and linker with
Run ./install or ./install openmp or ./install singlethread
After install there will be a shell script openpmx with the installed paths.
Some examples are available.
In the directory examples/schnider are the Schnider PK data reported in Schnider TW, Minto CF, Gambus PL,
Andresen C, Goodale DB, Shafer SL, Youngs EJ. The influence of method of
administration and covariates on the pharmacokinetics of propofol in adult
volunteers. Anesthesiology 1998;88:1170-82.
In this example a 3-compartment allometric model is estimated. The covariance limits are also calculated.
../../openpmx schnider.gr
The same example, but using the differential equation solver.
../../openpmx schnider_diffeqn.gr
The same example, but using the eigensystem solver.
../../openpmx schnider_eigen.gr
The same example, but using the eigensystem solver specialized to a three compartment model.
../../openpmx schnider_eigen_threecomp.gr
The basic example, but with different population paramaters structure that is loaded before starting estimation.
../../openpmx schnider_reload.gr
In directory examples/theo these are the Theophylline data from the NONMEM distribution.
../../openpmx theo.gr
In directory examples/warfarin contains data obtained from here and here.
The PK-PD analysis example is:
../../openpmx warfarin.gr
In directory examples/tci contains an example simulation of TCI infusion
simulations.
The ./tcisimulation script reproduces Figure 5 of Eleveld DJ, Colin P, Absalom AR, Struys MM. Pharmacokinetic–pharmacodynamic model for propofol for broad application in anaesthesia and sedation. British journal of anaesthesia. 2018 May 1;120(5):942-59.
but over a population from the NHANES data. The script requires R and Ghostscript.
- Your name (yourname@email.com) Very important thing elegantly coded.
- Jona Joachim (jona@joachim.cc) Contributed the code in
src/advan/ministanwhich is a modernized version of Stanpump. This is used in code for a TCI dosing controller. See the functionspmx_advan_tci_*andexamples/tci. - Erik Olofsen (e.olofsen@weggetjes.nl) contributed documentation for the control file.
- Jona Joachim (jona@joachim.cc) Contributed the eigensystem advancer
$ADVAN(eigen)which uses eigendecomposition to obtain exact, analytical solutions for any linear compartmental model. It can replace both the analytical ADVANs and the ODE solver, and is exact (no step size error) and general (any number of compartments, any topology). See the blogpost. - Douglas Eleveld (deleveld@dds.nl) Initial codebase.
- Make example showing how estimation of categorical variables is possible.
- Calculate NPDE.
- Generate VPCs.
- Do one thing and do it well.
- Fewer dependencies are better.
- Default settings should work well.
- Reproducibility is good.