In this work, we present the Bayesian workflow in the Pumas software for pharmacometrics (PMx) that’s: 1) demonstrably correct, 2) computationally efficient, and 3) user-friendly. Correctness-wise, Stan and its ecosystem of R packages arguably form the gold standard for Bayesian analysis of models that have many continuous parameters, which is the class of models commonly found in PMx. Stan has been developed, tested, and used over many years by many expert statisticians from different fields, making its implementation of MCMC the most battle-tested of all. Performance-wise, Stan also does extremely well on many problems thanks to its C++ implementation and many years of engineering work put into optimizing its Math library. The main limitations of Stan in PMx is that it is not tailored to PMx users, and the kinds of models found in PMx. Torsten tries to bridge the gap between PMx users and the Stan software, e.g. by making it easier to define dosing regimens. However, both Stan and Torsten only support Bayesian workflows so models would need to be translated from other software to compare Bayesian and non-Bayesian approaches. In Pumas, we present a user-friendly alternative to Stan/Torsten which:
1. Supports both Bayesian and non-Bayesian workflows using the same user-friendly, compact model syntax for hierarchical, dynamics-based models;
2. Uses Julia as the core programming language which is a fast, interactive, and easy-to-use language, providing an excellent user experience;
3. Automates the definition and computational optimization of PMx models, e.g. using automatic parallelism over subjects and automatic ODE linearity and stiffness detection, delivering high performance with a conise syntax;
4. Uses state-of-the-art stiff ODE solvers allowing superior performance compared to Stan for PMx models with stiff ODEs as demonstrated in this work;
5. Uses an open-source, modular implementation of the same MCMC algorithm Stan uses (AdvancedHMC.jl, also used in Turing.jl); and
6. Provides a complete, user-friendly Bayesian analysis workflow which includes: MCMC sampling, diagnostics, simulation, and customizable cross-validation using a few lines of code.