FeRx 0.4.0: model-building tools, new model types, and a faster engine
In early June I posted the first announcement of a new open source NLME engine for PK/PD analyses, FeRx. We’ve had a ton of positive reactions on this announcement, which strengthened our intention to continue to develop it into a production-grade, fully-featured software. The release of version 0.4.0 brings significant progress toward that goal. I’ll give a brief rundown, with pointers to the documentation.
New features
Because of the maturity of FeRx’s core engine, especially FOCEI and SAEM, we’ve recently started focusing on auxiliary modeling tools. For example, in this new release you will find tools for automated model building (using the same model feature language (MFL) as introduced in Pharmpy), as well as global search algorithms as for example available in pyDarwin. Combined with the increased speed of the engine, model searches are now a breeze. We also added GAM covariate screening and bootstrap tools, as well as improvements to the VPC (e.g. propensity-score matching).
We’ve added support for survival (TTE) models, stiff ODE solvers, mixture models, and Markov models.
We have also beefed up FeRx’s simulation capabilities; for example, it can now run adaptive simulations. The goal for our simulation engine is to ensure there is never a need to translate your model to mrgsolve or other simulation-specific software after your modeling is done, which is one of the most common bottlenecks experienced with current NLME engines.
Optimization / speed
We’ve made many updates to the computation of the analytical gradients that power the search algorithms, and made their re-use across the optimization more efficient. We dropped the off-the-shelf Enzyme library in favor of hand-rolled analytical gradients. FOCEI is now even faster than before, and more accurate (often an order of magnitude or more faster than NONMEM, single-threaded).
SAEM also got a speed boost and is now about 5x faster than NONMEM on average, mainly due to the implementation of f-SAEM, but also through refactoring of its implementation.
The computation of confidence intervals from the covariance matrix has had an upgrade, and is now faster and more accurate. See this paper for details.
Many settings are now optimized automatically depending on the dataset or the model, such as the optimizer, the choice of ODE solver, and tolerances.
Syntax & documentation
We implemented a novel and easier syntax for the covariate model. This serves two purposes. First, it is now easier for a modeler to separate the structural model from the covariate model, which also helps in communicating the model to others. Second, it allows safer and more structured implementation of covariate models and covariate searches. Most existing search tools add or remove covariate effects by regex’ing the model text; FeRx’s new syntax avoids this, so covariate effects can be added and removed programmatically. It is still possible to implement covariate models in the “classic” way, of course.
We’ve also added syntax that makes it extremely easy to define priors on model parameters.
As outlined in our design philosophy, we spend a lot of effort ensuring the documentation is up-to-date, complete, and easy to read. Our practical book on working with FeRx from R was fully revised.
Our new URL is live: please update your bookmarks to ferx-nlme.org!
Benchmarks
The plot below shows the speed of estimation in FeRx compared to NONMEM (v7.6.0, gfortran on Linux), both softwares single-threaded on an AMD Ryzen 7, using default settings for either software. These runs were all on real (final) PK models and datasets, not simulated scenarios. On average, models run about 10x faster in FeRx under FOCEI (slightly slower for some still, but up to 100x faster for others). SAEM is also generally much faster in FeRx. While being much faster, FeRx maintains accuracy: they reach the same minima as NONMEM. More detailed results will be shown at ACoP in October.


A full log of changes is always available on ferx-nlme.org. Please give FeRx a spin and let us know what you think!