Changelog
Source:NEWS.md
rxode2 2.1.2
CRAN release: 20240130
Other changes
rxUi
compression now defaults to fast compressionFixes String literal formatting issues as identified by CRAN (#643)
Removes linear compartment solutions with gradients for intel c++ compiler (since they crash the compiler).
rxode2 2.1.0
CRAN release: 20231211
Breaking changes
Steady state with lag times are no longer shifted by the lag time and then solved to steady state by default. In addition the steady state at the original time of dosing is also backcalculated. If you want the old behavior you can bring back the option with
ssAtDoseTime=FALSE
.“dop853” now uses the
hmax
/h0
values from therxControl()
orrxSolve()
. This may change some ODE solving using “dop853”When not specified (and xgxr is available), the x axis is no longer assumed to be in hours
New features
User defined functions can now be R functions. For many of these R functions they can be converted to C with
rxFun()
(you can see the C code afterwards withrxC("funName")
)Parallel solving of models that require sorting (like modeled lag times, modeled duration etc) now solve in parallel instead of downgrading to single threaded solving
Steady state infusions with a duration of infusions greater than the interdose interval are now supported.
Added
$symengineModelNoPrune
and$symengineModelPrune
for loading models into rxode2 withrxS()

When plotting and creating confidence intervals for multiple endpoint models simulated from a rxode2 ui model, you can plot/summarize each endpoint with
sim
. (ie.confint(model, "sim")
orplot(model, sim)
).If you only want to summarize a subset of endpoints, you can focus on the endpoint by prepending the endpoint with
sim.
For example if you wanted to plot/summarize only the endpointeff
you would usesim.eff
. (ieconfint(model, "sim.eff")
orplot(model, sim.eff)
) Added
model$simulationIniModel
which prepend the initial conditions in theini({})
block to the classicrxode2({})
model.Now
model$simulationModel
andmodel$simulationIniModel
will save and use the initialization values from the compiled model, and will solve as if it was the original ui model.Allow
ini(model) < NULL
to drop ini block andas.ini(NULL)
givesini({})
(Issue #523)Add a function
modelExtract()
to extract model lines to allow modifying them and then changing the model by piping or simply assigning the modified lines withmodel(ui) < newModifiedLines
Add Algebraic mureferencing detection (mu2) that allows you to express mureferenced covariates as:
Instead of the
cl < exp(tcl + eta.cl + wt_cl * log.WT.div.70.5)
That was previously required (where log.WT.div.70.5
was calculated in the data) for mu expressions. The ui
now has more information to allow transformation of data internally and transformation to the old mureferencing style to run the optimization.
Allow steady state infusions with a duration of infusion greater than the interdose interval to be solved.
Solves will now possibly print more information when issuing a “could not solve the system” error
The function
rxSetPipingAuto()
is now exported to change the way you affect piping in your individual setupAllow covariates to be specified in the model piping, that is
mod %>% model(a=var+3, cov="var")
will add"var"
as a covariate.When calculating confidence intervals for
rxode2
simulated objects you can now useby
to stratify the simulation summary. For example you can now stratify by gender and race by:confint(sim, "sim", by=c("race", "gender"))
When calculating the intervals for
rxode2
simulated objects you can now useci=FALSE
so that it only calculates the default intervals without bands on each of the percentiles; You can also choose not to match the secondary bands limits withlevels
but use your ownci=0.99
for instanceA new function was introduced
meanProbs()
which calculates the mean and expected confidence bands under either the normal or t distributionA related new function was introduced that calculates the mean and confidence bands under the Bernoulli/Binomial distribution (
binomProbs()
)When calculating the intervals for
rxode2
simulated objects you can also usemean=TRUE
to use the mean for the first level of confidence usingmeanProbs()
. For this confidence interval you can override then
used in the confidence interval by usingn=#
. You can also change this to a prediction interval instead usingpred=TRUE
.Also when calculating the intervals for
rxode2
simulated object you can also usemean="binom"
to use the binomial distributional information (and ci) for the first level of confidence usingbinomProbs()
. For this confidence interval you can override then
used in the confidence interval by usingn=#
. You can also change this to a prediction interval instead usingpred=TRUE
. Withpred=TRUE
you can override the number of predicted samples withm=#
When plotting the
confint
derived intervals from anrxode2
simulation, you can now subset based on a simulated value likeplot(ci, Cc)
which will only plot the variableCc
that you summarized even if you also summarizedeff
(for instance).When the rxode2 ui is a compressed ui object, you can modify the ini block with
$ini <
or modify the model block with$model <
. These are equivalent toini(model) <
andmodel(model) <
, respectively. Otherwise, the object is added to the user defined components in the function (ie$meta
). When the object is uncompressed, it simply assigns it to the environment instead (just like before).When printing meta information that happens to be a
lotri
compatible matrix, uselotri
to express it instead of the default R expression.Allow character vectors to be converted to expressions for piping (#552)
rxAppendModel()
will now take an arbitrary number of models and append them together; It also has better handling of models with duplicate parameters and models withoutini()
blocks (#617 / #573 / #575).keep
will now also keep attributes of the input data (with special handling forlevels
); This means a broader variety of classes will be kept carrying more information with it (for example ordered factors, data frame columns with unit information, etc)Piping arguments
append
forini()
andmodel()
have been aligned to perform similarly. Thereforeini(append=)
now can take expressions instead of simply strings andmodel(append=)
can also take strings. Also model piping now can specify the integer line number to be modified just like theini()
could. Alsomodel(append=FALSE)
has been changed tomodel(append=NULL)
. While the behavior is the same when you don’t specify the argument, the behavior has changed to align withini()
when piping. Hencemodel(append=TRUE)
will append andmodel(append=FALSE)
will now prepend to the model.model(append=NULL)
will modify lines like the behavior ofini(append=NULL)
. The default ofmodel(line)
modifying a line inplace still applies. While this is a breaking change, most code will perform the same.Labels can now be dropped by
ini(param=label(NULL))
. Also parameters can be dropped with the idiommodel(param=NULL)
orini(param=NULL)
changes the parameter to a covariate to align with this idiom of dropping parametersrxRename
has been refactored to run faster
Internal new features
Add
as.model()
for list expressions, which impliesmodel(ui) < ui$lstExpr
will assign model components. It will also more robustly work with character vectorsSimulated objects from
rxSolve
now can access the model variables with$rxModelVars
Simulation models from the UI now use
rxerr.endpoint
instead oferr.endpoint
for thesigma
residual error. This is to align with the convention that internally generated variables start withrx
ornlmixr
Sorting only uses timsort now, and was upgraded to the latest version from Morwenn
Bug fixes
Simulating/solving from functions/ui now prefers params over
omega
andsigma
in the model (#632)Piping does not add constants to the initial estimates
When constants are specified in the
model({})
block (likek < 1
), they will not be to theini
blockBug fix for
geom_amt()
when theaes
transformation hasx
Bug fix for some covariate updates that may affect multiple compartment models (like issue #581)
rxode2 2.0.14
CRAN release: 20231007
CRAN requested that FORTRAN
kind
be changed as it was not portable; This was commented code, and simply removed the comment.Bugfix for
geom_amt()
; also now useslinewidth
and at leastggplot2 3.4.0
Some documentation was cleaned up from
rxode2
2.0.13
rxode2 2.0.13
CRAN release: 20230422
New features
A new function
zeroRe()
allows simple setting of omega and/or sigma values to zero for a model (#456)Diagonal zeros in the
omega
andsigma
matrices are treated as zeros in the model. The correspondingomega
andsigma
matrices drop columns/rows where the diagonals are zero to create a newomega
andsigma
matrix for simulation. This is the same idiom that NONMEM uses for simulation from these matrices.Add the ability to pipe model estimates from another model by
parentModel %>% ini(modelWithNewEsts)
Add the ability to append model statements with piping using
%>% model(x=3, append=d/dt(depot))
, still supports appending withappend=TRUE
and prepending withappend=NA
(the default is to replace lines withappend=FALSE
)rxSolve’s keep argument will now maintain character and factor classes from input data with the same class (#190)
Parameter labels may now be modified via
ini(param = label("text"))
(#351).Parameter order may be modified via the
append
argument toini()
when piping a model. For example,ini(param = 1, append = 0)
orini(param = label("text"), append = "param2")
(#352).
Internal changes
If lower/upper bounds are outside the required bounds, the adjustment is displayed.
When initial values are piped that break the model’s boundary condition reset the boundary to unbounded and message which boundary was reset.
Added
as.rxUi()
function to convert the following objects torxUi
objects:rxode2
,rxModelVars
,function
. Converting nlmixr2 fits torxUi
will be placed in thes3
method in the corresponding package.assertRxUi(x)
now usesas.rxUi()
so that it can be extended outside ofrxode2
/nlmixr2
.rxode2
now supportsaddl
withss
dosesMoved
rxDerived
torxode2parse
(and reexported it here).Added test for transit compartment solving in absence of dosing to the transit compartment (fixed in
rxode2parse
but solving tested here)Using
ini()
without any arguments on arxode2
type function will return theini()
block. Also added a methodini(mod) < iniBlock
to modify theini
block is you wish.iniBlock
should be an expression.Using
model()
without any arguments on arxode2
type function will return themodel()
block. Also added a new methodmodel(mod) < modelBlock
Added a new method
rxode2(mod) < modFunction
which allows replacing the function with a new function while maintaining the meta information about the ui (like information that comes fromnonmem2rx
models). ThemodFunction
should be the body of the new function, the new function, or a newrxode2
ui.rxode2
ui objects now have a$sticky
item inside the internal (compressed) environment. This$sticky
tells what variables to keep if there is a “significant” change in the ui during piping or other sort of model change. This is respected during model piping, or modifying the model withini(mod)<
,model(mod)<
,rxode2(mod)<
. A significant change is a change in the model block, a change in the number of estimates, or a change to the value of the estimates. Estimate bounds, weather an estimate is fixed or estimate label changes are not considered significant.Added
as.ini()
method to convert various formats to an ini expression. It is used internally withini(mod)<
. If you want to assign something new that you can convert to an ini expression, add a method foras.ini()
.Added
as.model()
method to convert various formats to a model expression. It is used internally withmodel(mod)<
. If you want to assign something new that you can convert to a model expression, add a method foras.model()
.
rxode2 2.0.11
CRAN release: 20221101
Give a more meaningful error for ‘rxode2’ ui models with only error expressions
Break the ABI requirement between
roxde2()
andrxode2parse()
The new
rxode2parse
will fix thesprintf
exclusion shown on CRAN.
rxode2 2.0.10
CRAN release: 20221020
Time invariant covariates can now contain ‘NA’ values.
When a column has ‘NA’ for the entire id, now ‘rxode2’ warns about both the id and column instead of just the id.
To fix some CRAN issues in ‘nlmixr2est’, make the version dependency explicit.
rxode2 2.0.9
CRAN release: 20221019
Remove log likelihoods from ‘rxode2’ to reduce compilation time and increase maintainability of ‘rxode2’. They were transferred to ‘rxode2ll’ (requested by CRAN).
Remove the parsing from ‘rxode2’ and solved linear compartment code and move to ‘rxode2parse’ to reduce the compilation time (as requested by CRAN).
Remove the random number generation from ‘rxode2’ and move to ‘rxode2random’ to reduce the compilation time (as requested by CRAN).
Remove the event table translation and generation from ‘rxode2’ and move to ‘rxode2et’ to reduce the compilation time (as requested by CRAN).
Change the
rxode2
ui object so it is a compressed, serialized object by default. This could reduce theC stack size
problem that occurs with too many environments in R.Warn when ignoring items during simulations
Export a method to change ‘rxode2’ solve methods into internal integers
Bug fix for time invariant covariates identified as time variant covariate when the individual’s time starts after
0
.
rxode2 2.0.8
CRAN release: 20220923
Breaking changes
rxgamma
now only allows arate
input. This aligns with the internalrxode2
version ofrxgamma
and clarifies how this will be used. It is also aligned with thellikGamma
function used for generalized likelihood estimation.ui
cauchy
simulations now follow the ui fornormal
andt
distributions, which means you can combine with transformations. This is because thecauchy
is at
distribution with one degree of freedom.ui
dnorm()
andnorm()
are no longer equivalent toadd()
. Now it allows you to use the loglikllikNorm()
instead of the standardnlmixr2
style focei likelihood. This is done by addingdnorm()
at the end of the line. It also meansdnorm()
now doesn’t take any arguments.Vandercorput normal removed (nonrandom number generator)
New features
Allow models in the
nlmixr2
form without anini({})
blockAllow model piping of an omega matrix by
f %>% ini(omegaMatrix)
Standard models created with
rxode2()
can no be piped into a model functionFamilies of loglikelihood were added to
rxode2
so that mixed likelihood nonlinear mixed effects models may be specified and run.The memory footprint of a
rxode2
solving has been reducedPiping now allow named strings (issue #249)
Bug fixes
rxode2
’s symengine would convertsqrt(2)
toM_SQRT_2
when it should beM_SQRT2
. This has been fixed; it was most noticeable in nlmixr2 loglikelihood estimation methodsrxode2
treatsDV
as a noncovariate withetTran
(last time it would duplicate if it is in the model). This is most noticeable in the nlmixr2 loglikelihood estimation methods.
New features
A new flag (
rxFlag
) has been created to tell you where in therxode2
solving process you are. This is useful for debugging. If outputting this variable it will always be11
or calculating the left handed equations. If you are using in conjunction with theprintf()
methods, it is a double variable and should be formatted with"%f"
.An additional option of
fullPrint
has been added torxode2()
which allowsrprintf()
to be used in almost all ofrxode2()
steps (inductive linearization and matrix exponential are the exception here) instead of just the integrationddt
step. It defaults toFALSE
.
rxode2 2.0.7
CRAN release: 20220517
Removed accidental
^S
from news as requested by CRAN.Bug fix for more complicated mureferencing.
Change rxode2 md5 to only depend on the C/C++/Fortran code and headers not the R files. That way if there is binary compatibility between
nlmixr2est
andrxode2
, a new version ofnlmixr2est
will not need to be submitted to CRAN.
rxode2 2.0.6
CRAN release: 20220509
Breaking changes
Solving controls
The options for
rxControl
andrxSolve
are more strict.camelCase
is now always used. Old options likeadd.cov
andtransit_abs
are no longer supported, onlyaddCov
is supported.A new option,
sigdig
has been added torxControl()
, which controls some of the more common significant figure options likeatol
,rtol
,ssAtol
,ssRtol
, with a single option.
Simulations
For simulations,
$simulationSigma
now assumes a diagonal matrix. The sigma values are assumed to be standard normal, and uncorrelated between endpoints. Simulation with uncertainty will still draw from this identity diagonal matrixParallel solving now seeds each simulation per each individual based on the initial seed plus the simulation id. This makes the simulation reproducible regardless of the number of cores running the simulation.
Other breaking changes
Solved objects now access the underlying rxode model with
$rxode2
instead of$rxode
Since this change names,
rxode2
,rxode
andRxODE
all perform the same function.Options were changed from
RxODE.syntax
torxode2.syntax
.Assigning states with
rxode2.syntax.assign.state
(wasRxODE.syntax.assign.state
) is no longer supported.Enforcing “pure” assignment syntax with
=
syntax is no longer supported sorxode2.syntax.assign
is no longer supported (wasRxODE.syntax.assign
).Since R supports
**
as an exponentiation operator, the pure syntax without**
can no longer be enabled. Hencerxode2.syntax.star.pow
(wasRxODE.syntax.star.pow
) no longer has any effect.The “pure” syntax that requires a semicolon can no longer be enabled. Therefore
rxode2.syntax.require.semicolon
(wasRxODE.syntax.require.semicolon
) no longer has any effect.The syntax
state(0)
can no longer be turned off.rxode2.syntax.allow.ini0
(wasRxODE.syntax.allow.ini0
) has been removed.Variable with dots in variable and state names like
state.name
works in R. Therefore, “pure” syntax of excluding.
values from variables cannot be enforced withrxode2.syntax.allow.dots
(wasRxODE.syntax.allow.dots
).The mnemonic
et(rate=model)
andet(dur=model)
mnemonics have been removed.rate
needs to be set to1
and2
manually instead.The function
rxode2Test()
has been removed in favor of using testthat directly.Transit compartments need to use a new
evid
,evid=7
. That being said, thetransitAbs
option is no longer supported.ID
columns in input parameter data frames are not sorted or merged with original dataset any more; The underlying assumption of ID order should now be checked outside ofrxode2()
. Note that the event data frame is still sorted.
Additional features
The UI functions of
nlmixr
have been ported to work inrxode2
directly.rxModelVars({})
is now supported.You may now combine 2 models in
rxode2
withrxAppendModel()
. In fact, as long as the first value is a rxode2 evaluated ui model, you can usec
/rbind
to bind 2 or more models together.You may now append model lines with piping using
%>% model(lines, append=TRUE)
you can also prepend lines by%>% model(lines, append=NA)
You may now rename model variables, states and defined parameters with
%>% rxRename(new=old)
or ifdplyr
is loaded:%>% rename(new=old)
You can fix parameters with
%>% ini(tcl=fix)
or%>% ini(fix(tcl))
as well as unfix parameters with%>% ini(tcl=unfix)
or%>% ini(unfix(tcl))
Internal changes
Strict R headers are enforced more places
Since there are many changes that could be incompatible, this version has been renamed to
rxode2
rxode2()
printout no longer uses rules and centered headings to make it display better on a larger variety of systems.