nlmixr2extra (development version)
Bug fixes
-
preconditionFit()accepts a decorated covariance method.nlmixr2estreports the sandwich as"|r|,|s|"when a matrix needed the absolute-value correction (or"r+,s+"when it was nudged positive-definite), but the retry loop compared against the bare"r,s", so a good result read as a failure. It then re-preconditioned the already-preconditioned fit until the R matrix was numerically singular andsolve()gave up with “system is computationally singular”. A singular preconditioning matrix is now also reported as a preconditioning failure naming the try, rather than as a baresolve()error (#128).The same applies to the
" (full)"scope suffixnlmixr2estappends when the installed covariance spans theta + residual sigma + Omega rather than the structural-theta block alone (foceiControl(covFull=),TRUEby default), so"r,s (full)"is recognised as the sandwich too. The shape does not matter topreconditionFit(): the preconditioner is widened to whatever parameter space the returned covariance spans. preconditionFit()works again. It built the reparameterized model lines throughsymengine, which cannot parse an identifier containing a., so a conventional residual name likeadd.sd(asnlmixr2Pre_add.sd) raised “SymEngine exception: Parse error” and made the function unusable for most models. The lines are now assembled directly from the preconditioning matrix, which also drops thesymenginedependency from this path (#124).preconditionFit()no longer fails with “non-conformable arguments” on a model with random effects.fit$Rspans only the population parameters while the fit covariance also carries the omega elements, so the preconditioner is now widened to the covariance’s own parameter space – identity off the theta block – which keeps the theta/omega cross-covariances correct.
New features
-
New
multistart()re-estimates a model from many perturbed starting points, so a fit that settled in a local optimum can be recognised. It takes either a fit or a model plus data, works with any estimation method, and returns anlmixr2Multistartobject holding every start’s objective function and parameter estimates alongside the best fit.plot()on the result gives the objective-function waterfall (type = "waterfall", the default) and the parameter-stability plot (type = "parameters").Starting points are drawn around the initial estimates by
"uniform"(the default),"lhs"(Latin hypercube) or"normal"sampling, respecting fixed parameters and declared bounds. By default the candidates are pre-screened with a cheap empirical-Bayes objective evaluation so that only the most promising ones are fully estimated, and each start is cached to disk so that an interrupted run resumes where it left off. SeemultistartControl()for the options. ## Bug fixes linearize()works on a model with a correlated eta block. The generated model was built by pasting each entry ofui$etainto a model line, but for a correlated block that property also carries the off-diagonal entry – e.g.(eta.cl,eta.v)– which producedmu_(eta.cl,eta.v) = ...and failed to parse. The eta names are now taken from the diagonal of the ini data frame (#126).Regenerate the stored
theoFitOdefit. It was built against an older ‘nlmixr2est’, and its saved$controlno longer matched what the current estimator expects, so anything that re-ran the model through that control –bootstrapFit(),profile(), or a plainnlmixr2(fit$finalUiEnv, ..., control = fit$control)– failed with “attempt access index 130/129 in VECTOR_ELT”.
nlmixr2extra 5.2.0
CRAN release: 2026-08-04
Bug fixes
addorremoveCovariate()no longer turns theiniDfneta1/neta2columns into character (#110). The row it adds set them toNA_character_, andrbind()promotes the whole column to match, somax()andorder()on those columns became lexicographic further downstream – with ten or more etasmax()returned"9"rather than10, so the next eta index collided with an existing one.Ini rows that are built by hand (adding a covariate in
addorremoveCovariate(), adding thetas during linearization) no longer hard-code their column list, so they stillrbind()with aniniDfthat carries thepriorcolumn newer versions oflotriadd for prior distributions (#109). Both shapes of the data frame are handled, so this works withlotriversions that have the column and versions that do not.
New features
- New reporting helpers for comparing candidate models:
getMinAICFit()returns the fit with the lowest AIC,listModelsTested()builds aDescription/AIC/dAICtable ready forpander::pander(), andisBoundaryFit()reports whether a fit has a parameter at its boundary. By default both selection helpers exclude boundary fits. See the new “reporting helpers” article.
Bug fixes
Fix
bootstrapFit(stratVar=), which did not actually resample. The stratified branch calledsample(list(uids), ...), and sincelist(uids)has length one every draw returned the whole vector of subject ids, so the bootstrap datasets did not depend on the seed (#99). Three further problems in the same code are fixed with it: the new subject ids restarted at 1 in each stratum, so subjects from different strata were merged under a shared id; the sample was split across strata by the number of observations rather than the number of subjects, over-weighting strata whose subjects have more records; and rounding each stratum up could return more subjects thannSampIndivasked for.A stratified bootstrap now always draws whole subjects. When
stratVarchanged within a subject, that subject’s records were split between strata and resampled as separate (partial) subjects; each subject is now stratified by its first value, with a warning.nlmixr2extra:::sampling()now resolves itsuid_colnamedefault before using it. Called without one it sampledncol(data)subjects instead of the number of subjects in the data. It also accepts a tibble, which previously produced a one column tibble where a vector of subject ids was expected.Fix
covarSearchAuto()crashing with “wrong arguments for subsetting an environment” when a covariate is selected; the best model is now re-fit to recover its fit object. Also corrected the forward inclusion test, which had an inverted sign so improving covariates were never selected (#103)bootstrapFit()now works for models with a single estimated population parameter, a single random effect, or no random effects at all. Previously the bootstrap summary collapsed 1-row / 1x1 quantile arrays to vectors (and could not summarize aNULLomega), causingbootstrapFit()to error withdim(X) must have a positive length,incorrect number of dimensions, or'data' must be of a vector type, was 'NULL'. Printing the bootstrap summary of a model with no random effects no longer errors either.optimUnisampling()now keepsNandfloorTwhen it retries internally. Before, the recursive call reset them to the defaults, so asking for a sample size other than 1000, or for un-floored values, could silently return 1000 integer samples instead (#97)The bundled
theoFitOdefit was regenerated and can now be read without theqs2package. ItsorigDataandparHistDatahad been serialized withqs2, so without that package installed those slots could not be decoded andfit$dataMergeInner()– and anything built on it, such as thenlmixr2rptfigures – failed.
nlmixr2extra 5.1.0
CRAN release: 2026-06-07
Add focei/foce linearization
Add formula interface
Add vignettes on linearization, formula interface, log-likelihood profiling and preconditioning.
nlmixr2extra 2.0.9
CRAN release: 2024-01-31
bootstrapFit()now will be more careful handlingNAvalues so they do not completely affect results (Issue #59)bootstrapFit()will now only take the correlation of the non-zero diagonals (Issue #59).New method for
knit_print()will generate model equations for LaTeX reporting automatically.Tests are now skipped if they contain linear compartment models that need gradients when the gradients are not compiled (as in the case of intel c++).
nlmixr2extra 2.0.8
CRAN release: 2022-10-22
Use
assignInMyNamespace()instead of using the global assignment operator for the horseshoe priorBe specific in version requirements (as requested by CRAN checks)
Move the
theoFitOde.rdadata build todevtools::document()to reduce CRAN build time (could add more standard models like warfarin for package developers which takes way too much time for CRAN)
nlmixr2extra 2.0.7
CRAN release: 2022-10-19
Fix
cliissues with the newcli3.4+ release that will allow bootstrapping to run again (beforecliwould error, this fixes thedonttestissues on CRAN).Fixed step-wise covariate selection to work a bit better with the updated UI, thanks to Vishal Sarsani
Added lasso covariate selection (thanks to Vishal Sarsani)
Added horseshoe prior covarite selecion (thanks to Vishal Sarsani)
Added a
NEWS.mdfile to track changes to the package.
