Seamless simulation of Nonmem models from R

From: Philip Harder Delff Date: September 22, 2023 technical Source: mail-archive.com
Dear all, I am sharing a new R package on CRAN called NMsim for seamless simulation of Nonmem models from R with no reimplementation or translation of the Nonmem model needed. The interface allows to simulate a very wide range of Nonmem models this easily: > simres <- NMsim(path.mod="/path/to/nonmem/estimation/run.mod",data=data.sim) where "run.mod" is an _estimation_ input control stream (with an adjacent .ext with parameter estimates), and "data.sim" is an R data.frame with doses and simulation events. "simres" will contain simulation output and input data combined into one data.frame - ready for plotting and other postprocessing. The best place to explore it is on the NMsim website: https://philipdelff.github.io/NMsim/ There are two vignettes with examples under "Articles". NMsim provides an extensive list of features. Here are some highlights. All the features are activated using single arguments to the NMsim() function: * Simulation of new subjects (default method) * Simulation of a typical subject (ETAs equal 0) * Simulation of subjects already estimated in Nonmem model (ID's merged with estimated ETA's from .phi file) * Simulation with parameter uncertainty based on a Nonmem covariance step * Simulation of multiple models at a time. E.g., if a bootstrap run of a model is available, NMsim can run the simulation with each of the bootstrap models and collect all the results in one dataset. * Can submit jobs to clusters (so running the simulation on say 1,000 model estimates from a bootstrap is actually not that hard). * Simulation replicates using Nonmem `SUBPROBLEMS` feature avaible through the `subproblems` argument * Can modify the simulation control stream on the fly - a powerful feature for studying the effect of varying model parameters * Simulations of models on transformed observations can be automatically transformed back using the `transform` argument. * You can write your own methods, if you have some other Nonmem-based simulation (or other job) you want to automate using `NMsim`. I hope NMsim can be helpful to you as it is to me. If you have any questions, don't hesitate to reach out to me in any way. If you use github, https://github.com/philipdelff/NMsim/issues is the best place for bug reports and technical questions. If you are or want to be a Nonmem simulation and/or data.table expert and want to get involved in further development, I'm happy to hear from you. Best regards, Philip --