NMsim: Simulate Nonmem models seamlessly in R without any model reimplementation
Objectives: While Nonmem is widely used for its strengths and flexibility in estimation of pharmacometricsmodels, post-processing including simulation is often preferably handled in R. The new R packageNMsim (available on CRAN) fills this gap by allowing simulation of Nonmem models directlyfrom R. In contrast to other powerful simulation packages, NMsim relies on Nonmem to performthe simulation, hence eliminates the need for translating to other software.NMsim aims at providing a seamless and close to model-independent R interface to simulation ofNonmem models only dependent on estimation control stream and a simulation data set.NMsim works on both ADVAN subroutines and $PRED models and can currently perform the followingtypes of simulations:• New subjects (default)• Typical subject (ETAs equal 0)• Subjects already estimated in Nonmem model (EBE’s)• Simulation with parameter uncertaintyMoreover, NMsim provides an interface to modify control streams. This can among other things beused to modify parameter values.Methods: NMsim does not simulate, translate or otherwise interpret a Nonmem model. Instead, it automatesthe Nonmem simulation workflow (including execution of Nonmem). In the example given above,NMsim will do the following:• Save the simulation input data in a csv file for Nonmem• Create a simulation input control stream based on file.mod matching the saved simulationdata set• Update and fix initial values based on estimate (from file.ext)• Run Nonmem on the generated simulation control stream• Collect output data tables, combine them, and merge with the simulation input data• Return the collected data in RNMsim is written in R and data.table leveraging functionality from the NMdata R package.Results: NMsim provides a simulation interface that does not require reimplementation of a Nonmemmodel. This reduces amount of work and risk of errors. It allows for simulation of all intermediatemodel steps simplifying simulation-based model qualification, and for automation of a wide rangeof simulation based analyses.In this poster presentation, we showcase the capabilities of NMsim through examples of differenttypes of simulations of a popPK model. From the information provided on the poster and the freelyavailable R package, the audience will be able to perform simulations on their own models withoutany further model coding.Conclusions: By bridging the gap between Nonmem’s powerful modeling capabilities and the readily availabilityof a simulation interface in R, NMsim expedites model development and evaluation. We believethat our package will facilitate collaboration and innovation in the pharmacometrics community,ultimately advancing drug development efforts.Citations: [1] 2024. NMdata: Preparation, Checking and Post-Processing Data for PK/PD Modeling. https://cran.rproject.org/package=NMdata[2] 2024. NMsim: Simulate Nonmem models from R. https://philipdelff.github.io/NMsim[3] 2024. NMsim: Seamless ‘Nonmem’ Simulation Platform. https://cran.r-project.org/web/packages/NMsim
Authors
- Philip Delff
Publication Details
- Published
- 2025-02-18
- DOI
- https://doi.org/10.70534/pgju4426
- Primary Topic
- Machine Learning in Healthcare
- Type
- article
- Field-Weighted Citation Impact
- 0.00