Philip Delff1, Sanaya Shroff1
1Vertex Pharmaceuticals
INTRODUCTION/OBJECTIVES While NONMEM offers great flexibility for estimation of PK and PK/PD models, many users find the simulation features in NONMEM insufficient and turn to alternative software for simulation. This leads to additional work of model reimplementation, with risk of the simulation model deviating from the estimated model due to bugs in the reimplementation. For a wide range of model types, the limitation is not in NONMEM’s ability to perform such simulations, but rather in the lack of a simple user-interface to obtain the simulations. NMsim provides such an interface as an R package readily available on CRAN [1], allowing the modeler to simulate models directly from an estimation control stream. NMsim does not simulate, translate, or otherwise interpret a NONMEM model. The goal of NMsim is to automate the NONMEM simulation workflow and provide a simple, flexible, and powerful R interface. With this automation, post-processing of model estimates can to great extent be automated. METHODS NMsim does not simulate, translate or otherwise interpret a NONMEM model. Instead, it automates the NONMEM simulation workflow (including execution of NONMEM) and wraps it all into one R function. Provided with a path to a NONMEM control stream and a data frame to simulate, 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 • Update and fix initial values based on final estimates • 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 R Even if NMsim is run on a system where NONMEM cannot be executed, NMsim can still prepare the simulation control stream and data file. RESULTS NMsim provides a simple interface to rapidly simulate from a NONMEM model without translation or modification to the estimation control stream. With a single function call, NMsim can simulate: • Typical subjects (all ETAs=0) from a range of covariates provided • Known subjects from your estimation control stream • A cohort of new subjects based on an input data set • Multiple models simultaneously • Models with parameter uncertainty based on a successful covariance step or bootstrap The seamless workflow of NMsim allows code to be readily applicable to most NONMEM models, the user interface entirely within R. NMsim is in itself a relatively small R package, but makes extensive use of functionality to handle NONMEM data and control streams provided by the R package NMdata [2] and includes powerful features to handle large simulations, including the ability to submit and run simulations in parallel on a cluster. CONCLUSIONS NMsim provides a powerful tool to easily simulate NONMEM models with only a control stream path and simulation dataset and obviates the need for model translation or modification for simulation purposes. We hope these examples will aid pharmacometricians in making simulation more easily accessible by automating analyses, and can help support the design of clinical studies during the drug development process.
[1] Delff, Philip. 2024. NMsim: Seamless Nonmem Simulation Platform. https://cran.r-project.org/web/packages/NMsim [2] Delff, Philip. NMdata: Preparation, checking, and post processing data for PK/PD modeling. https://cran.r-project.org/packages/NMdata
Reference: PAGE 33 (2025) Abstr 11676 [www.page-meeting.org/?abstract=11676]
Poster: Methodology - New Modelling Approaches