Changelog
Source:NEWS.md
nlmixr2est 2.2.2
CRAN release: 20240528
Breaking changes
Saem nonmu reference input parameters/covariates were fixed so they work correctly with fixed parameters (Issue #445)
Focei changed back to having a lower bound for standard deviations when not specified. This means that best model fits may change. You can revert to the old settings by using
foceiControl(sdLowerFact=0.0)
. You can also change the factors to other values than the default value, that isfoceiControl(sdLowerFact=0.000001)
for instance which would multiply the initial value by0.000001
when either the lower bound isn’t specified or the lower bound is specified as zero for the error estimates related to errorbased standard deviations.
In
nlmixr2
, expressions are optimized. Because of that optimization, numerical rounding differences can cause different directions in optimization when fixing parameters in the model vs. fixing the parameters manually.This means that the fixed parameters in a model vs hardcoded fixed parameters could give different values in the final model.
A new option
literalFix
was introduced which change the fixed population parameters to constants in the model while running the optimization. This makes the output of fixing within the model and fixing manually the same (which is what is likely expected). The default is for this to be turned on (ie.literalFix=TRUE
). You can get back the old behavior by using the optionliteralFix=FALSE
. In
saem
, the montecarlo sampling occurs for all parameters including noninformative ETAs. A fix ensure that noninformative etas insaem
are fixed to zero while sampling thephi
values. This may change results for models with uninformative etas. To ignore the uninformative etas withsaem
you ca use use the priorsaem
handling withsaemControl(handleUninformativeEtas=FALSE)
.
New features
Gracefully degrade when $cov is not in the right form (see #423)
Add support for PopED in place solving (used in babelmixr2)
If
est=foceiControl()
or other nlmixr2 control with the classfoceiControl
infer the estimation method isfocei
nlmixr2est 2.2.1
CRAN release: 20240131
 Align with the possibility that linCmt sensitivities may not be present (like intel c++)
Bug fix

focei
cache needs to be based on the parameter order as well as the model information (#415)
nlmixr2est 2.2.0
CRAN release: 20231212
New Features
Algebraic mu referencing has been implemented in
nlme
andsaem
.New estimation method “nlm” has been added to estimate population only likelihoods using
stats::nlm
and possibly return a standardizednlmixr2
fit.New estimation method “nls” has been added to estimate population only problems. This uses
minpack.lm::nlsNM
by default if present, or thestats::nls
New estimation method “optim” has been added to estimate population only likelihoods. This uses
stats::optim
and returns a standardizednlmixr2
fit.New estimation method “nlminb” has been added to estimate population only likelihoods. This uses
stats::nlminb
and returns a standardizednlmixr2
fit.New estimation methods from the
minqa
package: “bobyqa”, “uobyqa” and “newuoa” have been added to estimate population only likelihoods. These methods returns a standardizednlmixr2
fit.New estimation method “lbfgsb3c” to estimate population only likelihoods. This returns a standardized
nlmixr2
fit.New estimation method “n1qn1” to estimate population only likelihoods. This returns a standardized
nlmixr2
fit.Added new feature for
vpcSim()
where a minimum number of subjects are simulated from the model when trying to fill in ODEs that were not solved successfully. By default this is10
. This also worksaround a bug when there is only one subject simulated and thedata.frame
has a slightly different output.
Breaking changes
Removed
fit$saemTransformedData
since it isn’t actually used insaem
anymore (but will break anyone’s code who is using it)Now the internal function
.foceiPreProcessData()
requires the rxode2 controlrxControl()
because some of the new steady state lag features need to translate the data differently based onrxControl()
options.
Bug fixes
Printing models with correlated omega values and omega values fixed to zero no longer fails (#359)
Add back values for $parHistData (#368)
This requires a new
rxode2
which will fix multiple endpoint issues observed (#394)Manual backtransformed values in
$parFixed
are now displaying correctly and are calculated based on the confidence interval in the control instead of 95% confidence no matter what (#397)
nlmixr2est 2.1.8
CRAN release: 20231008
 Version bump and a minor documentation update (same as nlmixr2est 2.1.7). This version bump is to simply allow correct binary linkage to rxode2 2.0.14. Otherwise
nlmixr2
models will crash R.
nlmixr2est 2.1.7
CRAN release: 20230918
As requested by CRAN, remove
Rvmmin
Values in
$parFixed
for BSV without exponential transformation are now correctly shown (#366)
nlmixr2est 2.1.6
CRAN release: 20230525
Breaking changes
 Since
rxode2
now allows simulation withomega
having diagonal zero elements,$omega
and$omegaR
now reflects this information including the zero omega elements in the output. On the other hand, the other etainformation and standard error information for zero etas are still excluded in$phiR
,$phiSE
,$eta
etc.
nlmixr2est 2.1.5
CRAN release: 20230422
Add
$fitMergeFull
,$fitMergInner
,$fitMergeLeft
,$fitMergeRight
as a complement to$dataMergeFull
,$dataMergInner
,$dataMergeLeft
,$dataMergeRight
. The fit variants prefer columns in the fit dataset instead of the original dataset. This is useful for goodness of fit plots with censoring since theDV
in the fit simulates values under the ipred/residual assumption and will give more appropriate goodness of fits, otherwise these values are the limit of whatever censoring is appliedMoved the mu reference fix for the split mu referenced model here (from babelmixr2)
nlmixr2est 2.1.4
CRAN release: 20230402
Breaking change, now calculate condition number based on covariance and correlation, the names have changed to be more explicit.
conditionNumber
changed toconditionNumberCov
and a new metricconditionNumberCor
has been added.A bug in boundary value detection prevented automatic covariance calculation with FOCEi estimation (#318)
Fix
vpcSim
so that it will be a bit more robust when it is difficult to simulate.A bug in model piping which did not allow models to be appended to was fixed (rxode2#364)
An internal change was made in
nlmixr2.rxUi()
to better support the babelmixr2 PKNCA estimation method (babelmixr2#75)Fixed bug where
$iniUi
did not return the initial ui when running nonfocei
related methods. Also added alias of$uiIni
to the same function.Dropped Stan headers for this package, also updated to C++17
nlmixr2est 2.1.3
CRAN release: 20221110
Allows
$etaH
and related family to be integrated into asaem
fit ifcwres
is calculated.Fixed a bug where
nlmixrLlikObs
in the merged dataset is sometimes namedllikObs
, now it is always namednlmixrLlikObs
Fixed a bug where
nlmixrLlikObs
shows up in merged dataset whencwres
is not calculated (it was always0
), also allowcwres
calculation to pick upnlmixrLlikObs
in merged dataset.Dropped
dparser
dependency
nlmixr2est 2.1.2
CRAN release: 20221102
Fixes
$etaH
memory corruption so the standard errors of etas are now correctRemoved the memory requirements for focei by
neta*neta*nsub
Fixed character based covariates so the work correctly (again) with focei. Added a test for this as well.
nlmixr2est 2.1.1
CRAN release: 20221022
Fixes
$dataMergeInner
so that observationbased loglikelihoods work with infusions. Should fix tests withggPMX
Fixes
$etaSE
and$etaRSE
to work correctly when there is only 1 eta.Fixes npde valgrind observed on CRAN machines
nlmixr2est 2.1.0
CRAN release: 20221019
Breaking changes
FOCEi
Gill forward differences will not repeat now (by default), You can change back to prior behavior with
foceiControl(repeatGillMax=3)
Number of sticky recalculation is reduced to 4; to have the old behavior use
foceiControl(stickyRecalcN=5)
n2ll
has been changed toll
to specify individual loglikelihoods. This was only used in simulation and was not well documented.Generalized loglikelihood is only supported with
rxode2
2.0.8
or later.
FOCEi covariance calculation
The
S
matrix calculation was made a bit more robust to errors in individual gradients. When there are errors in the individual gradient calculation, assume the gradient is the same as the overall gradient. In the tests cases, were reasonable using this adjusted S matrix. This means if some individuals do not have very much data to support a specific parameter, aS
matrix calculation for the population will still be generated. When there is some patients/subject combinations that do not have sufficient data, we will add the following to the run information:S matrix had problems solving for some subject and parameters
. TheS
matrix calculation will still fail if the percentage of parameters that are being reset is lower thanfoceiControl(smatPer=0.6)
or whatever you specify.The
r,s
covariance matrix will now also check for unreasonably small values (controlled byfoceiControl(covSmall=...)
) and select a different covariance estimate method even when the “r” and “s” matrices are calculated “correctly”.
New features
What type(s) censoring (if any) is now stored in
fit$censInformation
Standard errors of
$etas
can now be obtained withfit$phiSE
, also available arefit$phiRSE
(relative standard error),fit$phiH
, (individual hessian),fit$phiC
(individual covariances),fit$phiR
(individual correlation matrices)Can also use Shi 2021 differences in addition to Gill differences. In our tests (using the same datasets as CPT) these produced worse estimates than the Gill 1983, though it is unclear why since it should be a faster more accurate method. A modified version is used in calculating the individual Hessians of numerically for the generalized likelihood approach.
Generalized likelihood estimation is now present in
nlmixr2est
forfocei
,foce
andposthoc
nmNearPD()
is a function you may use for nearest positive definite matrix. This is derived fromMatrix::nearPD()
but is implemented in C/C++ to be used in (possibly threaded) optimization.Individual Hessians can be accessed by
$phiH
, covariance by$phiC
, eta standard errors by$phiSE
and eta RSEs can be accessed by$phiRSE
. There areeta
aliases for these as well ($etaH
,$etaC
,$etaSE
, and$etaRSE
).
Can now access the individual point’s contribution to the overall likelihood when merging to the original dataset. These merges can be accessed with
$dataMergeFull
,$dataMergeLeft
,$dataMergeRight
, and$dataMergeInner
. The columns with the individual data column isnlmixrLlikObs
.To calculate the total
focei
/foce
objective function, the sum of the likelihoods still need to be adjusted by the omega/eta contribution, and the individual Hessians, and possibly the NONMEM objective function offset constant.
Censoring fixes
 Fixed bug where datasets with censoring that are not lower case
cens
andlimit
do not produce the correct table output (#180)
nlmixr2est 2.0.8
CRAN release: 20220622
SAEM bug fix
 When loading a
nlmixr2
“saem” fit from another R session,nlmixr2
will no longer crash withfit$objf
NPDE/NPD fixes

NPDE
was identical toNPD
even with correlated models, this was fixed (prior output was actuallyNPDE
).
nlmixr2est 2.0.7
CRAN release: 20220523
Use
.zeros()
for the matrices in armadillo in addition to relying oncalloc
to give zero matrices.Fixed one uninitialized object
Fix for
augPred
so it works on population only modelsnlme
no longer sets options to treat all covariates as non mureferenced covariates, but directly calls a function that can turn on or off the mureference covariate selection.vpcSim
now tries to simulate IDs that didn’t simulate correctly (with a warning)Export nmObjHandleControlObject
nlmixr2est 2.0.6 – new package
CRAN release: 20220512
nlmixr2est
contains the estimation functions within nlmixr2
.
FOCEI family changes
Remove lower level
foceiFit
function. Focei, foce, fo, foi, and posthoc now directly takes rxode2 ui objectsNew error types are supported in focei including mixing theta and etas in residual errors and different types of proportional errors
Different types of additive and proportional errors can be used for each endpoint using
+ combined1()
or+ combined2()
otherwise it takes the suppliedaddProp
option to figure out which type of combined model is run (by defaultcombined2()
)Focei model cache is now named
foceimd5Digest.qs
and usesqs
compression/saving/loading.foceiControl()
aligned between other methods.foceiControl(adjLik=TRUE)
uses the NONMEMstyle objective function throughout.foceiControl(adjLik=FALSE)
uses the adjusted objective function throughout, and adjusts it back to the NONMEM objective function.Lag time and other between subject variability differences no longer calculate an ideal relative step size, but an absolute step size when using Gill differences (default)
Objective function checks for infinite/NaN/NA values for the entire solving space and ensures no overflow occurs when calculating the inner hessian
SAEM changes
mu referencing is no longer required for
saem
; Internally non mureferenced values are converted to mu referenced values and the converted back when calculating the nlmixr2 object.
nlmixr2
forced the parameter ordering to (1) population effects, non mureferenced between subject effects (3) omega estimates and (4) residual effects. This changes the order that
nlmixr2
sees the parameters. Since this is based on a random number generator, the optimization trajectory will be different and have different results thannlmixr
 non mureferenced between subject effects (3) omega estimates and (4) residual effects. This changes the order that
Components of
omega
can now be fixed.Residual error components can also be fixed.
When optimizing only one residual value, nlmixr2’s saem uses
nlm
from R, which is more efficient than the nealdermeade method.Lower level
saem
functions (likeconfigsaem()
) are not exported because they are increasingly difficult to use and convert to something standard; a few methods (likeprint
,summary
etc) are maintained to view the lower level object and for debugging it.Parameter history and printout no longer includes fixed parameters.
The model to calculate the residuals more closely matches the model used for estimation to remove small rounding differences that may occur in the models.
Different types of additive and proportional errors can be used for each endpoint using
+ combined1()
or+ combined2()
otherwise it takes the suppliedaddProp
option to figure out which type of combined model is run (by defaultcombined2()
)Parameter history and printout now uses standard deviation for additive only components, matching the estimation of the components.
rxode2
solving options are now saved in therxControl
part of thesaemControl()
. That issaemControl(rxControl=rxControl(...))
; This fixes any conflicting option names as well as allowing alignment between the control structures infocei
,nlme
andsaem
saemControl()
aligned between other methods.
nlme changes
nlme
has been completely rewritten to directly run from therxode2
UInlme
always tries to use mureferencing (when available)Internally
nlme
now uses parallel processing for solving so it should be faster.nlmixr2NlmeControl()
(which will overwritenlmeControl()
) documents and adds more options tonlme
. Also aligned with other methods.weights
,fixed
,random
can be specified innlmixr2NlmeControl()
. If so, then thenlme
object will be returned.returnNlme
is a new option that will return thenlme
object instead of the traditionalnlme
object.nlme_ode
andlme_lin_cmpt
are both removed.rxode2
solving options are now saved in therxControl
part of thesaemControl()
. That isnlmeControl(rxControl=rxControl(...))
; This fixes any conflicting option names as well as allowing alignment between the control structures infocei
,nlme
andsaem
nlmixr2 object change
With
saem
, the nlmixr2 function now saves/compresses thephiM
information. This means the gaussian and Laplacians likelihoods can be calculated when you save the nlmixr object and then restore it later.The nlmixr2 object compresses infrequently used and removes many unneeded objects. Even with compression, the
saem
objects are often a bit bigger since they include the largephiM
object.nlmixr2
now supports nonmu referenced ETAs in thefit$parFixed
andfit$parFixedDf
nlmixr2 interface change
nlmixr2
interface changed to userxode2
UIkeep
anddrop
are added totableControl
to influence the end dataframe$simInfo
uses a quoted expression for$rx
instead of a string$simInfo$sigma
is a diagonal matrix since now the normal simulation is controlled by the variability modeled as a population value.nlmixr2
now allows etas that have initial omega estimates of zero to be dropped from the model (instead of issuing an error about a nonpositive definite$omega
matrix)
NPDE changes
 Fixed a bug where the number of simulations for a NPDE calculation are correctly passed by
addNpde(fit, table=tableControl(nsim=500))
VPC changes
vpc
function rewritten and split out tovpcSim()
andvpcPlot()
(which is a replacement forvpc()
).There were too many mismatches between
vpc::vpc
andnlmixr::vpc
which caused inconsistencies in code based on load order ofvpc
andnlmixr
. This way both coexist, and you can use thevpc
simulation for other packages more easily (likeggPMX
) without creating or summarizing data sinceggPMX
has its own methods for summarizing and creating plots.VPC now directly uses
rxode2::rxSolve
augPred() changes
augPred()
has been written to use the new fit object.nlmixr2AugPred
was changed tonlmixr2AugPredSolve()
augPred
uses the new interface and supports multiple endpoints. The endpoint name is now always on theplot(augPred(fit))
.
getFitMethod() change
 Internally, fit estimation method is saved in
fit$est
, and nowgetFitMethod(fit)
simply returnsfit$est
Delete methods
Many methods lower level utility functions have been deleted.
nmDocx
,nmLst
andnmSave
have been removed.
Bug fixes
 Now will reset the cache when items cannot be loaded. In the past error messages like
function 'rx_0ba247452048de33b1ffb8af516714fc__calc_lhs' not provided by package 'rx_0ba247452048de33b1ffb8af516714fc_'
would cause the estimation to stop. Nowrxode2::rxClean()
is run when this occurs.