rxode2 (development version)
Added
dmexpit()for getting the diagonal Jacobian.Added special handling of
mixestandmixunif.
rxode2 4.1.1
CRAN release: 2025-10-08
Stacking for multiple-endpoint
ipredSimnow matches multiple-endpointsim; Issue #929Fix occasional
$propsthat threw an error with empty properties (when using properties liketad0()); Issue #924Allow mixture models
mix()to be loaded withrxS()as a step to support mixtures in nlmixr2’s focei; Issue #933.Identify the correct transformation type for
iovvariables (#936)Fix multiple compartment simulation edge cases where simulations were not being performed (#939)
When referencing
cmtin models, the variable is forced to beCMT(related to #939)Added ability to use
mixestormixunifto preserve the selected mixture estimates when performing a table step for a nlmixr2 mixture model (#942)
rxode2 4.1.0
CRAN release: 2025-08-29
Change rxui
$evaluation when completing in rstudio, fixes strange calculations popping up inrstudio(#909)Add orphan
rxode2model unloading when usingrxUnloadAll(), and change the return type to always be a boolean.Add
assertRxUiIovNoCorto assert IOVs have no correlations in them.Handle the levels for inter-occasion variability in the ui better (#614)
Create a new function
mix()that will allow mixture models to be simulated in preparation of mixture support innlmixr2. This allows mixture models to be specified as:v = mix(v1, p1, v2, p2, v3)where the probability of havingv=v1is modeled byp1,v=v2is modeled byp2, andv=v3is modeled by probability1-p1-p2.Created new functions
mlogit()andmexpit()to convert probabilities used in mixture models to log-scaled values.mlogit()converts the probabilities to log-scaled values (using root-finding) andmexpit()converts the log values into probabilities. The equation for the conversion of log to probabilities isAdded new assertion
assertRxUiNoMixwhich throws an error when a mixture model is present (iemix())Fix for label processing when calling
rxode2(uiModel)
rxode2 4.0.3
CRAN release: 2025-07-24
- For CRAN’s m1 ASAN checks of nlmixr2est, loading and unloading the same dll or by deleting the dll and recreating the exact same code, and then loading the dll will cause the ASAN check to flag an odr violation. Because of this, a mechanism to not unload dlls has been added. This allows the next version of
nlmixr2estto not have issues with Mac m1 san checks.
rxode2 4.0.2
CRAN release: 2025-07-21
At the request of CRAN, be a bit more careful so that names are not duplicated. Now include the md5 hash, a global counter and random 4 digit and number combination. In addition add the name of the original function so it will be easier to debug in the future.
Fall back to data.frame
rbindwhenrbind.rxSolve()fails
rxode2 4.0.1
CRAN release: 2025-07-17
Add the ability to use
rbindfor solvedrxode2frames.Fix
LTOissue for_rxode2_calcDerived
rxode2 4.0.0
CRAN release: 2025-07-16
Add more information errors about
NAs during solving.Fix
rxDerived()for mixed vector and non-vector input.Fix model variables for
alag(cmt)when they are defined befored/dt()orlinCmt()Just in time use of
state.ignorein the model variables, fixes negative length error observed in #857.Fix steady state bug with time-varying covariates. Now the covariates are inferred at the time of the steady state (instead of searching through the subject based on the projected time).
Rework the linear solved systems to use the wnl solutions, and threaded linear systems solve (for non-gradient solutions). This new method closes a variety of linear compartment model bugs (#261, #272, #441, #504, #564, #717, #728, #827, and #855)
-
Added new types of bounds for event tables:
3 point bounds
et(list(c(low, mid, high)))when specified this way, they will not change. Perfect for use withbabelmixr2’sPopED(#862, #863, #854)Intervals simulated by normal values instead of uniform. In this case the first seen interval will be 3 elements with NA at the end
et(list(c(mean, sd, NA), c(mean, sd))), and the other elements can simply be 2 declaring thec(mean, sd)Of course the uniform windows of
et(list(c(low, high)))still workCurrently these different types of windows cannot be mixed.
Add ability to pipe a list or named numeric as an eta with
%>% ini(~eta)Added a fix for event tables where expanding IDs in non-sequential order. In particular if the first ID is not the minimum ID when expanding the first event table, the smallest ID was not in the output table. Now the smallest ID is in the event table. (Fixes #878, #869, #870)
Added ability to pipe
ini()orlotri(), or any other expression that can be converted to an ini withas.ini(). Also allowsini()expressions to be converted to lotri withas.lotri(). Fixes #871Added new type of variability expression for simulation and estimation with focei and likelihood related methods:
+var(). This changes standard deviation parameters to variance parameters.Added new type of endpoint expression for focei estimation
+dv(). This only transforms the data and not the predictions. I can only see it being useful in model linearization.Bug fix for parameters that are in both input (
$params) and output ($lhs) that respects the order of the$lhsdeclaration (Fixes #876)Add
rxFixResto literally fix the residual estimates in a model (#889)Now modeled duration of 0 is treated as a bolus dose (#892)
rxode2 3.0.3
CRAN release: 2024-12-15
Add
logit/expitnamed expressions, that islogit(x, high=20)becomeslogit(x, 0, 20)in ui models.Updated random ui models like
rxnorm(sd=10)to accept complex numeric expressions likerxnorm(sd=10+1).Updated random ui models to accept complex non-numeric expressions like
rxnorm(sd=a+b)Rework the
tad()and related functions so they use the same interface as compartments (this way they do not depend on the order of compartments); See #815. For mu-referencing, Also allow dummy variables to ignore state requirements (iepodo(depot)in a single line will not error when parsing mu-referenced equations).Add
getRxNparsto api. This allows the development version ofbabelmixr2to better check what model is loaded and unload/reload as necessary.Add
rxUdfUiControl()to rxode2 user function to get control information from something likenlmixr2Bug fix for tracking time after dose when dosing to 2 compartments occur at the exact same time (#804, #819)
Change
transit()model so that it usestad0(),podo0()and related functions for a bit more stable simulation and estimationFix compile flags to work with BH 1.87 (#826)
rxode2 3.0.2
CRAN release: 2024-10-30
Bug fix for
api, the censoring function pointer has been updated (#801).Query
rxode2.verbose.pipeat run time instead of requiring it to be set before loadingrxode2.Have correct values at boundaries for
logit,expit,probit, andprobitInv(instead ofNA). For most cases this does not break anything.Add a new style of user function that modifies the
uiwhile parsing or just before using the function (in the presence ofdata).Used the new user function interface to allow all random functions in
rxode2ui functions to be named. For example, you can userxnorm(sd=3)instead of having to userxnorm(0, 3), althoughrxnorm()still works.
rxode2 3.0.1
CRAN release: 2024-09-22
- Explicitly initialize the order vector to stop valgrind warning (requested from CRAN)
rxode2 3.0.0
CRAN release: 2024-09-18
Breaking Changes
The model properties was moved from
$paramsto$propsso it does not conflict with the low levelrxode2model$paramsError when specifying
wdwithoutmodNameWith Linear and midpoint of a time between two points, how
rxode2handles missing values has changed. When the missing value is lower than the requested time, it will look backward until it finds the first non-missing value (or if all are missing start looking forward). When the missing value is higher than the requested time, the algorithm will look forward until it finds the first non-missing value (or if all are missing, start looking backward).The order of ODEs is now only determined by the order of
cmt()andd/dt(). Compartment properties,tad()and other compartment related variables no no longer affect compartment sorting. The optionrxode2.syntax.require.ode.firstno longer does anything.-
The handling of zeros “safely” has changed (see #775)
when
safeZero=TRUEand the denominator of a division expression is zero, use the Machine’s small number/eps(you can see this value with.Machine$double.eps)when
saveLog=TRUEand the x in thelog(x)is less than or equal to zero, change this tolog(eps)when
safePow=TRUEand the expressionx^yhas a zero forxand a negative number foryreplacexwitheps.
Since the protection for divide by zero has changed, the results will also change. This is a more conservative protection mechanism than was applied previously.
Random numbers from
rxode2are different when usingdop853,lsodaorindLinmethods. These now seed the random numbers in the same way asliblsoda, so the random number provided will be the same with different solving methods.The arguments saved in the
rxSolvefor items likethetaMatwill be the reduced matrices used in solving, not the full matrices (this will likely not break very many items)
Possible breaking changes (though unlikely)
-
iCovis no longer merged to the event dataset. This makes solving withiCovslightly faster (#743)
New features
You can remove covariances for every omega by piping with
%>% ini(diag())you can be a bit more granular by removing all covariances that have eithereta.kaoreta.clby:%>% ini(diag(eta.ka, eta.cl))or anything with correlations witheta.clwith%>% ini(diag(eta.cl))You can also remove individual covariances by
%>% ini(-cov(a, b))or%>% ini(-cor(a,b)).-
You can specify the type of interpolation applied for added dosing records (or other added records) for columns that are kept with the
keep=option inrxSolve(). This new option iskeepInterpolationand can belocffor last observation carried forward,nocbwhich is the next observation carried backward, as well asNAwhich puts aNAin all imputed data rows. See #756.Note: when interpolation is linear/midpoint for factors/characters it changes to locf with a warning (#759)
Also note, that the default keep interpolation is
na
-
Now you can specify the interpolation method per covariate in the model:
linear(var1, var2)says bothvar1andvar2would use linear interpolation when they are a time-varying covariate. You could also uselinear(var1)locf()declares variables using last observation carried forwardnocb()declares variables using next observation carried backwardmidpoint()declares variables using midpoint interpolation
linear(),locf(),locb(),midpoint(),params(),cmt()anddvid()declarations are now ignored when loading arxode2model withrxS()Strings can be assigned to variables in
rxode2.Strings can now be enclosed with a single quote as well as a double quote. This limitation was only in the rxode2 using string since the R-parser changes single quotes to double quotes. (This has no impact with
rxode2({})and ui/function form).More robust string encoding for symengine (adapted from
utils::URLencode()andutils::URLdecode())Empty arguments to
rxRename()give a warning (#688)Promoting from covariates to parameters with model piping (via
ini()) now allows setting bounds (#692)Added
assertCompartmentName(),assertCompartmentExists(),assertCompartmentNew(),testCompartmentExists(),assertVariableExists()testVariableExists(),assertVariableNew(),assertVariableName(), andassertParameterValue()to verify that a value is a valid nlmixr2 compartment name, nlmixr2 compartment/variable exists in the model, variable name, or parameter value (#726; #733)Added
assertRxUnbounded(),testRxUnbounded(),warnRxBounded()to allownlmixr2warn about methods that ignore boundaries #760Added functions
tad0(),tafd0(),tlast0()andtfirst0()that will give0instead ofNAwhen the dose has not been administered yet. This is useful for use in ODEs sinceNAs will break the solving (so can be used a bit more robustly with models like Weibull absorption).rxode2is has no more binary link tolotri, which means that changes in thelotripackage will not requirerxode2to be recompiled (in most cases) and will not crash the system.rxode2also has no more binary linkage toPreciseSumsThe binary linkage for
dparseris reduced to C structures only, making changes in dparser less likely to cause segmentation faults inrxode2if it wasn’t recompiled.A new model property has been added to
$props$cmtPropand$statePropDf. Both are data-frames showing which compartment has properties (currentlyini,f,alag,rateanddur) in therxode2ui model. This comes from the lower level model variable$statePropwhich has this information encoded in integers for each state.A new generic method
rxUiDeparsecan be used to deparse meta information into more readable expressions; This currently by default supports lower triangular matrices by lotri, but can be extended to support other types of objects like ’nlmixr2’sfoceiControl()for instance.
Bug fixes
Fix
ui$props$endpointwhen the ui endpoint is defined in terms of the ode instead of lhs. See #754Fix
ui$propswhen the ui is a linear compartment model withoutkadefined.Model extraction
modelExtract()will now extract model properties. Note that the model property ofalag(cmt)andlag(cmt)will give the same value. See #745When assigning reserved variables, the parser will error. See #744
Linear interpolation will now adjust the times as well as the values when
NAvalues are observed.Fix when keeping data has
NAvalues that it will not crash R; Also fixed some incorrectNAinterpolations. See #756When using
cmt()sometimes the next statement would be corrupted in the normalized syntax (like for instancelocf); This bug was fixed (#763)keepwill now error when trying to keep items that are in the rxode2 output data-frame and will be calculated (#764)
Big change
- At the request of CRAN, combine
rxode2parse,rxode2random, andrxode2etinto this package; The changes in each of the packages are now placed here:
rxode2et (no changes before merge)
rxode2et 2.0.11
Make the stacking more flexible to help rxode2 have more types of plots
Add
toTrialDurationby Omar Elashkar to convert event data to trial duration dataFix Issue #23 and prefer variable values over NSE values
rxode2et 2.0.9
Split off
et(),eventTable()and related functions.Also split off
rxStack()andrxCbindStudyIndividual()in this package.Added a
NEWS.mdfile to track changes to the package.
rxode2random (before merge)
- Fix a bug when simulating nested variables (#25)
rxode2random 2.1.0
-
Breaking Change changed distributions from the standard C++
<random>toboost::random. Since this is not dependent on the compiler, it makes the random numbers generated from Mac, Windows and Linux the same for every distribution. Unfortunately with a new random number transformation, the simulation results will likely be different than they were before. The exception to this is the uniform number, which was always the same between platforms.
rxode2random 2.0.12
Added function
dfWishartwhich gives (by simulation) an approximation of the degrees of freedom of a Wishart to match arsevalue.Added function
swapMatListWithCubewhich swaps omegaList with omegaCube valuesEnsure that the outputs are integers (instead of long integers) as requested by CRAN for some checking functions.
rxode2parse (fixed before merging)
- As requested by CRAN remove the C code
SET_TYPEOFwhich is no longer part of the C R API.
rxode2parse 2.0.19
Added a evid suffix of 60 for cases where evid=2 adds an on event (fixes tad() calculation in certain edge cases)
Initialize all variables to
NA
rxode2parse 2.0.18
Removed linear compartment solutions with gradients from rxode2parse (and rxode2) when compiled with intel c++ compiler (since it crashes while compiling).
Fixed
m1macstring issues as requested by CRAN
rxode2parse 2.0.17
Added ability to query R user functions in a rxode2 model (will force single threaded solve)
Moved core
rxFunParseandrxRmFunParsehere so that C and R user function clashes can be handledModel variables now tracks which compartments have a lag-time defined
For compartment with steady state doses (NONMEM equivalent SS=1, SS=2), an additional tracking time-point is added at to track the time when the lagged dose is given. As an upshot, the lagged dose will start at the steady state concentration shifted by + ii - lag in
rxode2(currently for ode systems only)This release calculates non bio-availability adjusted duration for all rates instead of trying to figure the rate duration during solving.
Make double assignment an error, ie
a <- b <-NAtimes are ignored (with warning)Steady state bolus doses with
addlare treated as non steady state events (like what is observed inNONMEM)Timsort was upgraded; drop radix support in rxode2 structure
etTransnow supports keeping logical vectors (with the appropriate version ofrxode2).Security fixes were applied as requested by CRAN
rxode2parse 2.0.16
- Import
data.tableexplicitly in the R code (before was imported only in C/C++ code)
rxode2parse 2.0.14
‘linCmt()’ translations of ‘alpha’, ‘beta’, ‘gamma’, ‘k21’, ‘k31’, ‘vc’ now error instead of ignoring ‘gamma’ and ‘k31’ to give 2 cmt solution
transit compartment internal code now changes dose to 0.0 when no dose has been administered to the depot compartment. This way dosing to the central compartment (without dosing to the transit compartment) will not give a
NAfor the depot compartment (and consequently for the central compartment)Moved
rxDerivedhere and added tests for it here as well.-
Moved
etTransParsehere and added tests for it here as well (makes up most ofetTrans). In addition the following changes were made toetTransParse()/etTrans():The internal translation (
etTrans()) will not drop times when infusions stop. Before, if the infusion stopped after the last observation the time when the infusion stopped would be dropped. This interferes withlinCmt()models.Breaking change/bug fix
evid=2are considered observations when translating data to internalrxode2event structureFix edge case to find infusion duration when it is the first item of the dosing record at time 0.
Fixed a bug for certain infusions where the
rate,iiand/orssdata items were dropped from the output whenaddDosing=TRUEAlso have internal functions to convert between classic NONMEM events and rxode2 events
Have an internal function that gives information on the linear compartmental model translation type, which could be useful for babelmixr2
‘time’ in model is now case insensitive
Use function declaration in
rxode2parseGetTranslation()to determine thread safety of functions available to rxode2Add check for correct number of function arguments to parser.
Like R, known functions can be assigned as a variable and the function can still be called (while not changing the variable value). For example you can have a variable
gammaas well as a functiongamma().Fix garbled error messages that occur with certain messages.
Fixed errors that occurred when using capitalized AMT variables in the model.
rxode2parse 2.0.12
Bug fix for strict prototypes
Removed
sprintfas noted by CRANMade
rxode2parsedll binary independent ofrxode2()
rxode2 2.1.3
CRAN release: 2024-05-28
New features
Create a function to see if a rxode2 solve is loaded in memory (
rxode2::rxSolveSetup())Create a new function that fixes the rxode2 population values in the model (and drops them in the initial estimates);
rxFixPop()
rxode2 2.1.2
CRAN release: 2024-01-30
Other changes
rxUicompression 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: 2023-12-11
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 back-calculated. If you want the old behavior you can bring back the option with
ssAtDoseTime=FALSE.“dop853” now uses the
hmax/h0values 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 inter-dose interval are now supported.
Added
$symengineModelNoPruneand$symengineModelPrunefor 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 pre-pending the endpoint with
sim.For example if you wanted to plot/summarize only the endpointeffyou would usesim.eff. (ieconfint(model, "sim.eff")orplot(model, sim.eff)) Added
model$simulationIniModelwhich prepend the initial conditions in theini({})block to the classicrxode2({})model.Now
model$simulationModelandmodel$simulationIniModelwill save and use the initialization values from the compiled model, and will solve as if it was the original ui model.Allow
ini(model) <- NULLto 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) <- newModifiedLinesAdd Algebraic mu-referencing detection (mu2) that allows you to express mu-referenced 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 mu-referencing style to run the optimization.
Allow steady state infusions with a duration of infusion greater than the inter-dose 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
rxode2simulated objects you can now usebyto 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
rxode2simulated objects you can now useci=FALSEso 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 withlevelsbut use your ownci=0.99for 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
rxode2simulated objects you can also usemean=TRUEto use the mean for the first level of confidence usingmeanProbs(). For this confidence interval you can override thenused in the confidence interval by usingn=#. You can also change this to a prediction interval instead usingpred=TRUE.Also when calculating the intervals for
rxode2simulated 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 thenused in the confidence interval by usingn=#. You can also change this to a prediction interval instead usingpred=TRUE. Withpred=TRUEyou can override the number of predicted samples withm=#When plotting the
confintderived intervals from anrxode2simulation, you can now subset based on a simulated value likeplot(ci, Cc)which will only plot the variableCcthat 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
lotricompatible matrix, uselotrito 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).keepwill 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
appendforini()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 pre-pend to the model.model(append=NULL)will modify lines like the behavior ofini(append=NULL). The default ofmodel(line)modifying a line in-place 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 parametersrxRenamehas been refactored to run faster
Internal new features
Add
as.model()for list expressions, which impliesmodel(ui) <- ui$lstExprwill assign model components. It will also more robustly work with character vectorsSimulated objects from
rxSolvenow can access the model variables with$rxModelVarsSimulation models from the UI now use
rxerr.endpointinstead oferr.endpointfor thesigmaresidual error. This is to align with the convention that internally generated variables start withrxornlmixrSorting only uses timsort now, and was upgraded to the latest version from Morwenn
Bug fixes
Simulating/solving from functions/ui now prefers params over
omegaandsigmain 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 theiniblockBug fix for
geom_amt()when theaestransformation hasxBug fix for some covariate updates that may affect multiple compartment models (like issue #581)
rxode2 2.0.14
CRAN release: 2023-10-07
CRAN requested that FORTRAN
kindbe changed as it was not portable; This was commented code, and simply removed the comment.Bug-fix for
geom_amt(); also now useslinewidthand at leastggplot2 3.4.0Some documentation was cleaned up from
rxode22.0.13
rxode2 2.0.13
CRAN release: 2023-04-22
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
omegaandsigmamatrices are treated as zeros in the model. The correspondingomegaandsigmamatrices drop columns/rows where the diagonals are zero to create a newomegaandsigmamatrix 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=TRUEand pre-pending 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
appendargument 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 torxUiobjects:rxode2,rxModelVars,function. Converting nlmixr2 fits torxUiwill be placed in thes3method in the corresponding package.assertRxUi(x)now usesas.rxUi()so that it can be extended outside ofrxode2/nlmixr2.rxode2now supportsaddlwithssdosesMoved
rxDerivedtorxode2parse(and re-exported it here).Added test for transit compartment solving in absence of dosing to the transit compartment (fixed in
rxode2parsebut solving tested here)Using
ini()without any arguments on arxode2type function will return theini()block. Also added a methodini(mod) <- iniBlockto modify theiniblock is you wish.iniBlockshould be an expression.Using
model()without any arguments on arxode2type function will return themodel()block. Also added a new methodmodel(mod) <- modelBlockAdded a new method
rxode2(mod) <- modFunctionwhich allows replacing the function with a new function while maintaining the meta information about the ui (like information that comes fromnonmem2rxmodels). ThemodFunctionshould be the body of the new function, the new function, or a newrxode2ui.rxode2ui objects now have a$stickyitem inside the internal (compressed) environment. This$stickytells 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: 2022-11-01
Give a more meaningful error for ‘rxode2’ ui models with only error expressions
Break the ABI requirement between
roxde2()andrxode2parse()The new
rxode2parsewill fix thesprintfexclusion shown on CRAN.
rxode2 2.0.10
CRAN release: 2022-10-20
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: 2022-10-19
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
rxode2ui object so it is a compressed, serialized object by default. This could reduce theC stack sizeproblem 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: 2022-09-23
Breaking changes
rxgammanow only allows arateinput. This aligns with the internalrxode2version ofrxgammaand clarifies how this will be used. It is also aligned with thellikGammafunction used for generalized likelihood estimation.ui
cauchysimulations now follow the ui fornormalandtdistributions, which means you can combine with transformations. This is because thecauchyis atdistribution with one degree of freedom.ui
dnorm()andnorm()are no longer equivalent toadd(). Now it allows you to use the loglikllikNorm()instead of the standardnlmixr2style 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 (non-random number generator)
New features
Allow models in the
nlmixr2form 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 log-likelihood were added to
rxode2so that mixed likelihood nonlinear mixed effects models may be specified and run.The memory footprint of a
rxode2solving has been reducedPiping now allow named strings (issue #249)
Bug fixes
rxode2’s symengine would convertsqrt(2)toM_SQRT_2when it should beM_SQRT2. This has been fixed; it was most noticeable in nlmixr2 log-likelihood estimation methodsrxode2treatsDVas a non-covariate withetTran(last time it would duplicate if it is in the model). This is most noticeable in the nlmixr2 log-likelihood estimation methods.
New features
A new flag (
rxFlag) has been created to tell you where in therxode2solving process you are. This is useful for debugging. If outputting this variable it will always be11or 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
fullPrinthas 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 integrationddtstep. It defaults toFALSE.
rxode2 2.0.7
CRAN release: 2022-05-17
Removed accidental
^Sfrom news as requested by CRAN.Bug fix for more complicated mu-referencing.
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
nlmixr2estandrxode2, a new version ofnlmixr2estwill not need to be submitted to CRAN.
rxode2 2.0.6
CRAN release: 2022-05-09
Breaking changes
Solving controls
The options for
rxControlandrxSolveare more strict.camelCaseis now always used. Old options likeadd.covandtransit_absare no longer supported, onlyaddCovis supported.A new option,
sigdighas been added torxControl(), which controls some of the more common significant figure options likeatol,rtol,ssAtol,ssRtol, with a single option.
Simulations
For simulations,
$simulationSigmanow 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
$rxode2instead of$rxodeSince this change names,
rxode2,rxodeandRxODEall perform the same function.Options were changed from
RxODE.syntaxtorxode2.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.assignis 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.nameworks 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.rateneeds to be set to-1and-2manually 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, thetransitAbsoption is no longer supported.IDcolumns 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
nlmixrhave been ported to work inrxode2directly.rxModelVars({})is now supported.You may now combine 2 models in
rxode2withrxAppendModel(). In fact, as long as the first value is a rxode2 evaluated ui model, you can usec/rbindto bind 2 or more models together.You may now append model lines with piping using
%>% model(lines, append=TRUE)you can also pre-pend lines by%>% model(lines, append=NA)You may now rename model variables, states and defined parameters with
%>% rxRename(new=old)or ifdplyris 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
rxode2rxode2()printout no longer uses rules and centered headings to make it display better on a larger variety of systems.
