nlmixr2/rxode2 exploring data with rxode2 geoms

rxode2 and ggplot rxode2 (and nlmixr2) uses ggplot internally. This means most things are compatible with ggplot2. One thing that is not quite as widely known that rxode2 has some custom geom functions that are useful for exploring pharmacometrics data. geom_amt() – exploring when dosing occurs rxode2 will allow exploring time of dosing with the geom_amt(). From the geom_amt() documentation we can see how this is applied: library(rxode2) library(units) ## udunits database from /usr/share/xml/udunits/udunits2.

By Matthew Fidler in rxode2

May 31, 2025

nlmixr2 Neural Network ODEs with pmxNODE

Neural Network ODEs and nlmixr2 I have had some requests to talk about nlmixr2 using neural network ODEs, since neural networks are something that more people are exploring with the explosion of artificial intelligence LLMs. There is a package, pmxNODE, by Dominic Bräm that adds neural network ODEs to pharmacometric modeling tools like NONMEM, Monolix and nlmixr2. In addition to the code that Dominic has added, I extended this package to allow Neural Networks directly in a rxode2 or nlmixr2 model.

nlmixr2 augmented plot

This month I will on a single nlmixr2’s plot function that is shared with nlme, augPred(). I think this is useful but also harder to find like the rxode2 plots discussed last month. The example of this feature is the phenobarbitol data: library(nlmixr2) pheno <- function() { ini({ tcl <- log(0.008) # typical value of clearance tv <- log(0.6) # typical value of volume ## var(eta.cl) eta.cl + eta.v ~ c(1, 0.

By Matthew Fidler in nlmixr2

March 31, 2025

rxode2 plotting

This month I will focus on rxode2’s plotting functions. I think these are very useful but not very well known. In general I will focus on three things: plotting single subjects, plotting multiple subjects and plotting confidence bands. Plot functions rxode2 plotting Of course discussion of plotting require a model and simulation, so we will use the model from the original tutorial: library(rxode2) ## Model from rxode2 tutorial m1 <- rxode2({ KA <- 2.

By Matthew Fidler in rxode2

February 25, 2025

nlmixr2/rxode2 user functions to modify code

This month I will talk about a new type of user function. Previously, I spoke of user functions that you can use in your code to extend the functionality of rxode2 and nlmixr2. Recently we released the ability for certain functions to generate code. I will go over examples that could be helpful to extend rxode2 ui models: An example that allows arguments to be named inside of the rxode2 ui models (though classic models still do not allow this).

By Matthew Fidler in rxode2

January 24, 2025