| Type: | Package |
| Title: | Use 'nlmixr2' to Interact with Open Source and Commercial Software |
| Version: | 0.1.12 |
| Description: | Run other estimation and simulation software via the 'nlmixr2' (Fidler et al (2019) <doi:10.1002/psp4.12445>) interface including 'PKNCA', 'NONMEM' and 'Monolix'. It also converts 'nlmixr2'/'rxode2' models to 'PopED' optimal design databases (Fidler et al (2024) <doi:10.70534/XUMG6226>). While not required, you can get/install the 'lixoftConnectors' package in the 'Monolix' installation, as described at the following url https://monolixsuite.slp-software.com/r-functions/2024R1/installation-and-initialization. When 'lixoftConnectors' is available, 'Monolix' can be run directly instead of setting up command line usage. |
| License: | GPL (≥ 3) |
| URL: | https://nlmixr2.github.io/babelmixr2/, https://github.com/nlmixr2/babelmixr2/ |
| NeedsCompilation: | yes |
| Encoding: | UTF-8 |
| Suggests: | qs2, testthat, withr, lixoftConnectors, PKNCA (≥ 0.10.0), rmarkdown, spelling, PopED, units (≥ 0.8-6), nlme, dplyr, devtools, memoise, FME, coda, crayon, saemix, lme4, nlmixr2lib |
| Depends: | R (≥ 3.5) |
| Imports: | checkmate, cli, digest, lotri, nlmixr2data, nlmixr2extra, nlmixr2plot, magrittr, nlmixr2est (≥ 6.2.0), nonmem2rx (≥ 0.1.5), monolix2rx (≥ 0.0.3), methods, rex, rxode2 (≥ 5.1.8) |
| Config/testthat/edition: | 3 |
| LinkingTo: | Rcpp, rxode2, RcppArmadillo, RcppEigen |
| Language: | en-US |
| Config/roxygen2/version: | 8.1.0 |
| Packaged: | 2026-10-16 16:51:19 UTC; matt-fidler |
| Author: | Matthew Fidler |
| Maintainer: | Matthew Fidler <matthew.fidler@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-10-16 17:40:07 UTC |
When the model is loaded, this function is called to evaluate the -2* log-likelihood value for FME::modMCMC()
Description
This should not be called directly
Usage
.fmeMcmcF(p)
Arguments
p |
parameter to evaluate |
Value
-2 * log-likelihood value
Author(s)
Matthew L. Fidler
Accessor for the nlmer formula currently being fit
Description
lme4::nlmer() captures match.call()$formula and re-evaluates it deep in
its own call stack, where the babelmixr2 fit locals are not in scope, so the
formula must be referenced through an exported, namespace-qualified call
rather than a ::: reference to the package's internal .nlmerGlobal
(which CRAN disallows). This returns the 3-part formula stashed by
.nlmerFitModel() for the in-progress fit.
Usage
.nlmerCurrentFormula()
Value
The 3-part nlmer formula for the active fit, or NULL when no fit
is in progress.
Surrogate gradient function for lme4::nlmer
Description
Computes predictions and the analytical gradient for every observation
using the nlm C machinery (a single multithreaded nlmixr2est::nlmerSolveGrad()
call against the model kept resident by nlmixr2est::.nlmSetupEnv()).
Parameters arrive in positional order matching
.nlmerGlobal$nlmerEnv$paramNames (THETA[i] order).
Usage
.nlmerNlmerFun(TIME, ...)
Arguments
TIME |
Observation times vector (unused; kept for formula compatibility – the solver uses the resident per-subject event data) |
... |
Individual-level parameter vectors (one per param in
|
Details
lme4 passes one value per observation for each nonlinear parameter; within a subject these are constant (phi = beta + b), so the per-subject parameter vector is read from each subject's first observation row.
Value
Numeric vector of predictions with "gradient" attribute
Internal function to use with PopED to run PopED in parallel on Windows
Description
Internal function to use with PopED to run PopED in parallel on Windows
Usage
.popedCluster(babelmixr2)
Arguments
babelmixr2 |
environment in poped environment |
Value
nothing, called for side effects
Author(s)
Matthew L. Fidler
Get the function value from the rxode2 solve
Description
This shouldn't be called directly
Usage
.popedF(popedDb)
Arguments
popedDb |
poped DB with babelmixr2 issue |
Value
rxode2 weights for the poped error function
Author(s)
Matthew L. Fidler
Free Poped memory (if any is allocated)
Description
This should not be called directly but is used in babelmixr2's poped interface
Usage
.popedFree()
Value
nothing, called for side effects
Author(s)
Matthew L. Fidler
Setup poped if needed
Description
Should not be called by user
Usage
.popedRxRunSetup(popedDb)
Value
nothing, called for side effects
Author(s)
Matthew L. Fidler
Setup the PopED environment
Description
This should not typically be called directly
Usage
.popedSetup(e, eglobal, full = FALSE)
Arguments
e |
environment with setup information for popEd |
eglobal |
global environment for poped info |
full |
setup the full model |
Value
nothing, called for side effects
Author(s)
Matthew L. Fidler
Solve poped problem for appropriate times with single/multiple endpoint models
Description
This really should not be called directly (if not setup correctly can crash R)
Usage
.popedSolveIdME(theta, umt, mt, ms, nend, id, totn)
.popedSolveIdME2(theta, umt, mt, ms, nend, id, totn)
Arguments
theta |
parameters (includes covariates and modeling times) |
umt |
unique times sampled |
mt |
original unsorted time (to match the f/w against) |
ms |
model switch parameter integer starting with 1 (related to dvid in rxode2) |
nend |
specifies the number of endpoints in this model |
id |
this is the design identifier |
totn |
This is the total number of design points tested |
Value
a data frame with $f and $w corresponding to the function value and standard deviation at the sampling point
Author(s)
Matthew L. Fidler
Get the weight from the rxode2 solve
Description
This shouldn't be called directly
Usage
.popedW(popedDb)
Arguments
popedDb |
poped DB with babelmixr2 issue |
Value
rxode2 weights for the poped error function
Author(s)
Matthew L. Fidler
When the model is loaded, this function is called to evaluate the -2* log-likelihood value for FME::modMCMC()
Description
This should not be called directly
Usage
.pseudoOptimF(p)
Arguments
p |
parameter to evaluate |
Value
-2 * log-likelihood value
Author(s)
Matthew L. Fidler
Setup the poped database
Description
Setup the poped database
Usage
.setupPopEDdatabase(ui, data, control)
Arguments
ui |
rxode2 ui function |
data |
babelmixr2 design data |
control |
PopED control |
Value
PopED database
Author(s)
Matthew L. Fidler
Convert an object to a nlmixr2 fit object
Description
Convert an object to a nlmixr2 fit object
Usage
as.nlmixr2(
x,
...,
table = nlmixr2est::tableControl(),
rxControl = rxode2::rxControl(),
ci = 0.95
)
as.nlmixr(
x,
...,
table = nlmixr2est::tableControl(),
rxControl = rxode2::rxControl(),
ci = 0.95
)
Arguments
x |
Object to convert |
... |
Other arguments |
table |
is the |
rxControl |
is the |
ci |
is the confidence interval of the residual differences calculated (by default 0.95) |
Value
nlmixr2 fit object
Author(s)
Matthew L. Fidler
Examples
# First read in the model (but without residuals)
mod <- nonmem2rx(system.file("mods/cpt/runODE032.ctl", package="nonmem2rx"),
determineError=FALSE, lst=".res", save=FALSE)
# define the model with residuals (and change the name of the
# parameters) In this step you need to be careful to not change the
# estimates and make sure the residual estimates are correct (could
# have to change var to sd).
mod2 <-function() {
ini({
lcl <- 1.37034036528946
lvc <- 4.19814911033061
lq <- 1.38003493562413
lvp <- 3.87657341967489
RSV <- c(0, 0.196446108190896, 1)
eta.cl ~ 0.101251418415006
eta.v ~ 0.0993872449483344
eta.q ~ 0.101302674763154
eta.v2 ~ 0.0730497519364148
})
model({
cmt(CENTRAL)
cmt(PERI)
cl <- exp(lcl + eta.cl)
v <- exp(lvc + eta.v)
q <- exp(lq + eta.q)
v2 <- exp(lvp + eta.v2)
v1 <- v
scale1 <- v
k21 <- q/v2
k12 <- q/v
d/dt(CENTRAL) <- k21 * PERI - k12 * CENTRAL - cl * CENTRAL/v1
d/dt(PERI) <- -k21 * PERI + k12 * CENTRAL
f <- CENTRAL/scale1
f ~ prop(RSV)
})
}
# now we create another nonmem2rx object that validates the model above:
new <- as.nonmem2rx(mod2, mod)
# once that is done, you can translate to a full nlmixr2 fit (if you wish)
fit <- as.nlmixr2(new)
print(fit)
Expand a babelmixr2 PopED database
Description
Expand a babelmixr2 PopED database
Usage
babel.poped.database(popedInput, ..., optTime = NA)
Arguments
popedInput |
The babelmixr2 generated PopED database |
... |
other parameters sent to |
optTime |
boolean to indicate if the global time indexer
inside of babelmixr2 is reset if the times are different. By
default this is |
Value
babelmixr2 PopED database (with $babelmixr2 in database)
Author(s)
Matthew L. Fidler
References
Fidler ML, Denney W, Harrold J, Hooijmaijers R, Papathanasiou T, Schoemaker R, Taubert M, Trame M, Wilkins J (2024). babelmixr2 and PopED: Quick Conversion of NONMEM, Monolix and nlmixr2/rxode2 Models to PopED Optimal Design Analysis. American Conference on Pharmacometrics (ACoP) 2024. doi:10.70534/XUMG6226
Get the bpop_idx by variable name for a poped database created by babelmixr2
Description
This may work for other poped databases if the population parameters are named.
Usage
babelBpopIdx(popedInput, var)
Arguments
popedInput |
The babelmixr2 created database |
var |
variable to query |
Value
index of the variable
Author(s)
Matthew L. Fidler
Examples
if (requireNamespace("PopED", quietly=TRUE)) {
f <- function() {
ini({
tV <- 72.8
tKa <- 0.25
tCl <- 3.75
tF <- fix(0.9)
pedCL <- 0.8
eta.v ~ 0.09
eta.ka ~ 0.09
eta.cl ~0.25^2
prop.sd <- fix(sqrt(0.04))
add.sd <- fix(sqrt(5e-6))
})
model({
V<-tV*exp(eta.v)
KA<-tKa*exp(eta.ka) * (pedCL**isPediatric) # add covariate for pediatrics
CL<-tCl*exp(eta.cl)
Favail <- tF
N <- floor(t/TAU)+1
y <- (DOSE*Favail/V)*(KA/(KA - CL/V)) *
(exp(-CL/V * (t - (N - 1) * TAU)) *
(1 - exp(-N * CL/V * TAU))/(1 - exp(-CL/V * TAU)) -
exp(-KA * (t - (N - 1) * TAU)) * (1 - exp(-N * KA * TAU))/(1 - exp(-KA * TAU)))
y ~ prop(prop.sd) + add(add.sd)
})
}
e <- et(c( 1,8,10,240,245))
babel.db <- nlmixr2(f, e, "poped",
popedControl(m = 2,
groupsize=20,
bUseGrouped_xt=TRUE,
a=list(c(DOSE=20,TAU=24,isPediatric = 0),
c(DOSE=40, TAU=24,isPediatric = 0))))
babelBpopIdx(babel.db, "pedCL")
}
Convert nlmixr2-compatible data to other formats (if possible)
Description
Convert nlmixr2-compatible data to other formats (if possible)
Usage
bblDatToMonolix(
model,
data,
table = nlmixr2est::tableControl(),
rxControl = rxode2::rxControl(),
env = NULL
)
bblDatToNonmem(
model,
data,
table = nlmixr2est::tableControl(),
rxControl = rxode2::rxControl(),
env = NULL
)
bblDatToRxode(
model,
data,
table = nlmixr2est::tableControl(),
rxControl = rxode2::rxControl(),
env = NULL
)
bblDatToMrgsolve(
model,
data,
table = nlmixr2est::tableControl(),
rxControl = rxode2::rxControl(),
env = NULL
)
bblDatToPknca(
model,
data,
table = nlmixr2est::tableControl(),
rxControl = rxode2::rxControl(),
env = NULL
)
Arguments
model |
rxode2 model for conversion |
data |
Input dataset. |
table |
is the table control; this is mostly to figure out if there are additional columns to keep. |
rxControl |
is the rxode2 control options; This is to figure out how to handle the addl dosing information. |
env |
When |
Value
With the function bblDatToMonolix() return a list with:
Monolix compatible dataset ($monolix)
Monolix ADM information ($adm)
With the function nlmixrDataToNonmem() return a dataset that is
compatible with NONMEM.
With the function nlmixrDataToMrgsolve() return a dataset that is
compatible with mrgsolve. Unlike NONMEM, it supports replacement
events with evid=8 (note with rxode2 replacement evid is 5).
With the function nlmixrDataToRxode() this will normalize the
dataset to use newer evid definitions that are closer to NONMEM
instead of any classic definitions that are used at a lower level
Author(s)
Matthew L. Fidler
Examples
pk.turnover.emax3 <- function() {
ini({
tktr <- log(1)
tka <- log(1)
tcl <- log(0.1)
tv <- log(10)
##
eta.ktr ~ 1
eta.ka ~ 1
eta.cl ~ 2
eta.v ~ 1
prop.err <- 0.1
pkadd.err <- 0.1
##
temax <- logit(0.8)
tec50 <- log(0.5)
tkout <- log(0.05)
te0 <- log(100)
##
eta.emax ~ .5
eta.ec50 ~ .5
eta.kout ~ .5
eta.e0 ~ .5
##
pdadd.err <- 10
})
model({
ktr <- exp(tktr + eta.ktr)
ka <- exp(tka + eta.ka)
cl <- exp(tcl + eta.cl)
v <- exp(tv + eta.v)
emax = expit(temax+eta.emax)
ec50 = exp(tec50 + eta.ec50)
kout = exp(tkout + eta.kout)
e0 = exp(te0 + eta.e0)
##
DCP = center/v
PD=1-emax*DCP/(ec50+DCP)
##
effect(0) = e0
kin = e0*kout
##
d/dt(depot) = -ktr * depot
d/dt(gut) = ktr * depot -ka * gut
d/dt(center) = ka * gut - cl / v * center
d/dt(effect) = kin*PD -kout*effect
##
cp = center / v
cp ~ prop(prop.err) + add(pkadd.err)
effect ~ add(pdadd.err) | pca
})
}
bblDatToMonolix(pk.turnover.emax3, nlmixr2data::warfarin)
bblDatToNonmem(pk.turnover.emax3, nlmixr2data::warfarin)
bblDatToMrgsolve(pk.turnover.emax3, nlmixr2data::warfarin)
bblDatToRxode(pk.turnover.emax3, nlmixr2data::warfarin)
Control for fmeMcmc estimation method in nlmixr2
Description
Control for fmeMcmc estimation method in nlmixr2
Usage
fmeMcmcControl(
jump = NULL,
prior = NULL,
niter = 1000L,
outputlength = niter,
burninlength = 0,
updatecov = niter,
covscale = NULL,
ntrydr = 1,
drscale = NULL,
verbose = FALSE,
seed = 99,
returnFmeMcmc = FALSE,
stickyRecalcN = 4,
maxOdeRecalc = 5,
odeRecalcFactor = 10^(0.5),
indTolRelax = TRUE,
useColor = NULL,
printNcol = NULL,
print = 1L,
normType = c("rescale2", "mean", "rescale", "std", "len", "constant"),
scaleType = c("none", "nlmixr2", "norm", "mult", "multAdd"),
scaleCmax = 1e+05,
scaleCmin = 1e-05,
scaleC = NULL,
scaleTo = 1,
rxControl = NULL,
optExpression = TRUE,
sumProd = FALSE,
literalFix = TRUE,
literalFixRes = TRUE,
addProp = c("combined2", "combined1"),
calcTables = TRUE,
compress = TRUE,
covMethod = c("mcmc", "r", ""),
adjObf = TRUE,
ci = 0.95,
sigdig = 4,
sigdigTable = NULL,
eventSens = c("jump", "fd"),
...
)
Arguments
jump |
jump length, either a number, a vector with length equal to the total number of parameters, a covariance matrix, or a function that takes as input the current values of the parameters and produces as output the perturbed parameters. See details. |
prior |
-2 * log(prior parameter probability), either a function
called as |
niter |
number of iterations for the MCMC. |
outputlength |
number of iterations kept in the output; should
be smaller or equal to |
burninlength |
number of initial iterations to be removed from output. |
updatecov |
number of iterations after which the parameter covariance matrix is (re)evaluated based on the parameters kept thus far, and used to update the MCMC jumps. |
covscale |
scale factor for the parameter covariance matrix, used to perform the MCMC jumps. |
ntrydr |
maximal number of tries for the delayed rejection procedure. It is generally not a good idea to set this to a too large value. |
drscale |
for each try during delayed rejection, the cholesky
decomposition of the proposal matrix is scaled with this amount; if
|
verbose |
if |
seed |
an integer seed used for the mcmc chain. The chain is
fully determined by this seed, so a fixed value makes the fit
reproducible. The run is wrapped in |
returnFmeMcmc |
return the fmeMcmc output instead of the nlmixr2 fit |
stickyRecalcN |
The number of bad ODE solves before reducing the atol/rtol for the rest of the problem. |
maxOdeRecalc |
Maximum number of times to reduce the ODE tolerances and try to resolve the system if there was a bad ODE solve. |
odeRecalcFactor |
The ODE recalculation factor when ODE solving goes bad, this is the factor the rtol/atol is reduced |
indTolRelax |
when |
useColor |
Logical (or 'NULL') emit ANSI bold/color escapes in the iteration print. 'NULL' (default) defers to [crayon::has_color()]. |
printNcol |
Integer (or 'NULL') parameter columns per row before wrapping. 'NULL' (default) uses 'floor((getOption("width") - 23) / 12)'. |
print |
Either a scalar print-frequency ('0' = suppress, '1' (default) = every evaluation, 'N' = every Nth), OR a pre-built [iterPrintControl()] object. Equivalent to 'iterPrintControl(every = print, ncol = printNcol, useColor = useColor)'. |
normType |
Parameter normalization/scaling used to get scaled
initial values for |
scaleType |
The scaling scheme for nlmixr2: |
scaleCmax |
Maximum value of the scaleC to prevent overflow. |
scaleCmin |
Minimum value of the scaleC to prevent underflow. |
scaleC |
Scaling constant used with |
scaleTo |
Scale the initial parameter estimate to this value. By default this is 1. When zero or below, no scaling is performed. |
rxControl |
'rxode2' ODE solving options during fitting, created with 'rxControl()' |
optExpression |
Optimize the rxode2 expression to speed up calculation. By default this is turned on. |
sumProd |
Is a boolean indicating if the model should change
multiplication to high precision multiplication and sums to
high precision sums using the PreciseSums package. By default
this is |
literalFix |
boolean, substitute fixed population values as literals and re-adjust ui and parameter estimates after optimization; Default is 'TRUE'. |
literalFixRes |
boolean, substitute fixed population values as literals and re-adjust ui and parameter estimates after optimization; Default is 'TRUE'. |
addProp |
Type of additive-plus-proportional error: '"combined1"', where standard deviations add:
; or '"combined2"', where variances add:
. Here y = observed, f = predicted, a = additive sd, b = proportional/power sd, c = power exponent (1 in the proportional case). |
calcTables |
This boolean is to determine if the foceiFit
will calculate tables. By default this is |
compress |
Should the object have compressed items |
covMethod |
Method for calculating the covariance. |
adjObf |
is a boolean to indicate if the objective function
should be adjusted to be closer to NONMEM's default objective
function. By default this is |
ci |
Confidence level for some tables. By default this is 0.95 or 95% confidence. |
sigdig |
Optimization significant digits. One value drives, with a single
consistent formula, the inner/outer optimizer convergence tolerance
( |
sigdigTable |
Significant digits in the final output table. If not specified ('NULL'), it defaults to 'sigdig'. |
eventSens |
method used for the dosing-parameter (alag/F/rate/dur)
sensitivities: |
... |
Ignored parameters |
Value
fmeMcmc control structure
Author(s)
Matthew L. Fidler
Examples
# A logit regression example with emax model
dsn <- data.frame(i=1:1000)
dsn$time <- exp(rnorm(1000))
dsn$DV=rbinom(1000,1,exp(-1+dsn$time)/(1+exp(-1+dsn$time)))
mod <- function() {
ini({
E0 <- 0.5
Em <- 0.5
E50 <- 2
g <- fix(2)
})
model({
v <- E0+Em*time^g/(E50^g+time^g)
ll(bin) ~ DV * v - log(1 + exp(v))
})
}
fit2 <- nlmixr(mod, dsn, est="fmeMcmc")
print(fit2)
# you can also get the FME modMCMC output with
# fit2$fmeMcmc
# And use it in the summaries from FME, i.e.
summary(fit2$fmeMcmc)
pairs(fit2$fmeMcmc)
# and you can also use the coda package with `as.mcmc()`
coda::raftery.diag(coda::as.mcmc(fit2))
Determine standardized rxode2 column names from data
Description
Determine standardized rxode2 column names from data
Usage
getStandardColNames(data)
Arguments
data |
A data.frame as the source for column names |
Value
A named character vector where the names are the standardized names
and the values are either the name of the column from the data or NA
if the column is not present in the data.
Examples
getStandardColNames(data.frame(ID=1, DV=2, Time=3, CmT=4))
Unit conversion for pharmacokinetic models
Description
Unit conversion for pharmacokinetic models
Usage
modelUnitConversion(
dvu = NA_character_,
amtu = NA_character_,
timeu = NA_character_,
volumeu = NA_character_
)
Arguments
dvu, amtu, timeu |
The units for the DV, AMT, and TIME columns in the data |
volumeu |
The units for the volume parameters in the model |
Value
A list with names for the units associated with each parameter
("amtu", "clearanceu", "volumeu", "timeu", "dvu") and the numeric value to
multiply the modeled estimate (for example, cp) so that the model is
consistent with the data units.
See Also
Other Unit conversion:
simplifyUnit()
Examples
modelUnitConversion(dvu = "ng/mL", amtu = "mg", timeu = "hr", volumeu = "L")
Monolix Controller for nlmixr2
Description
Monolix Controller for nlmixr2
Usage
monolixControl(
nbSSDoses = 7,
useLinearization = FALSE,
stiff = FALSE,
linCmt = c("pkmodel", "ode"),
prune = "auto",
addProp = c("combined2", "combined1"),
exploratoryAutoStop = FALSE,
smoothingAutoStop = FALSE,
burnInIterations = 5,
smoothingIterations = 200,
exploratoryIterations = 250,
simulatedAnnealingIterations = 250,
exploratoryInterval = 200,
exploratoryAlpha = 0,
omegaTau = 0.95,
errorModelTau = 0.95,
variability = c("none", "firstStage", "decreasing"),
runCommand = getOption("babelmixr2.monolix", ""),
rxControl = NULL,
sumProd = FALSE,
optExpression = TRUE,
calcTables = TRUE,
compress = TRUE,
ci = 0.95,
sigdigTable = NULL,
absolutePath = FALSE,
modelName = NULL,
muRefCovAlg = TRUE,
run = TRUE,
...
)
Arguments
nbSSDoses |
Number of steady state doses (default 7) |
useLinearization |
Use linearization for log likelihood and fim. |
stiff |
boolean for using the stiff ODE solver |
linCmt |
How a |
prune |
How |
addProp |
Type of additive-plus-proportional error: '"combined1"', where standard deviations add:
; or '"combined2"', where variances add:
. Here y = observed, f = predicted, a = additive sd, b = proportional/power sd, c = power exponent (1 in the proportional case). |
exploratoryAutoStop |
logical to turn on or off exploratory phase auto-stop of SAEM (default 250) |
smoothingAutoStop |
Boolean indicating if the smoothing should
automatically stop (default |
burnInIterations |
Number of burn in iterations |
smoothingIterations |
Number of smoothing iterations |
exploratoryIterations |
Number of iterations for exploratory phase (default 250) |
simulatedAnnealingIterations |
Number of simulating annealing iterations |
exploratoryInterval |
Minimum number of iterations in the exploratory phase (default 200) |
exploratoryAlpha |
Convergence memory in the exploratory phase
(only used when |
omegaTau |
Proportional rate on variance for simulated annealing |
errorModelTau |
Proportional rate on error model for simulated annealing |
variability |
This describes the methodology for parameters without variability. It could be: - Fixed throughout (none) - Variability in the first stage (firstStage) - Decreasing until it reaches the fixed value (decreasing) |
runCommand |
is a shell command or function to run monolix; You can specify
the default by
|
rxControl |
'rxode2' ODE solving options during fitting, created with 'rxControl()' |
sumProd |
Is a boolean indicating if the model should change
multiplication to high precision multiplication and sums to
high precision sums using the PreciseSums package. By default
this is |
optExpression |
Optimize the rxode2 expression to speed up calculation. By default this is turned on. |
calcTables |
This boolean is to determine if the foceiFit
will calculate tables. By default this is |
compress |
Should the object have compressed items |
ci |
Confidence level for some tables. By default this is 0.95 or 95% confidence. |
sigdigTable |
Significant digits in the final output table. If not specified ('NULL'), it defaults to 'sigdig'. |
absolutePath |
Boolean indicating if the absolute path should be used for the monolix runs |
modelName |
Model name used to generate the NONMEM output. If
|
muRefCovAlg |
When 'TRUE' (default), algebraic expressions that can
be mu-referenced are internally rewritten as mu-referenced
covariates and restored after optimization. Mirrors
|
run |
Should monolix be run and the results be imported to nlmixr2? (Default is TRUE) |
... |
Ignored parameters |
Details
If runCommand is given as a string, it will be called with the
system() command like:
runCommand mlxtran.
For example, if runCommand="'/path/to/monolix/mlxbsub2021' -p " then the command line
used would look like the following:
'/path/to/monolix/mlxbsub2021' monolix.mlxtran
If runCommand is given as a function, it will be called as
FUN(mlxtran, directory, ui) to run Monolix. This allows you to run Monolix
in any way that you may need, as long as you can write it in R. babelmixr2
will wait for the function to return before proceeding.
If runCommand is NA, nlmixr() will stop after writing
the model files and without starting Monolix.
Note that you can get the translated monolix components from a
parsed/compiled rxode2 ui object with ui$monolixModel and ui$mlxtran
Value
A monolix control object
Author(s)
Matthew Fidler
nlmixr2 estimation using lme4::nlmer
Description
nlmixr2 estimation using lme4::nlmer
Usage
## S3 method for class 'nlmer'
nlmixr2Est(env, ...)
Arguments
env |
Environment for the nlmixr2 estimation routines. This needs to have: - rxode2 ui object in '$ui' - data to fit in the estimation routine in '$data' - control for the estimation routine's control options in '$ui' |
... |
Other arguments provided to 'nlmixr2Est()' provided for flexibility but not currently used inside nlmixr |
Estimate starting parameters using PKNCA
Description
Estimate starting parameters using PKNCA
Usage
## S3 method for class 'pknca'
nlmixr2Est(env, ...)
Arguments
env |
Environment for the nlmixr2 estimation routines. This needs to have: - rxode2 ui object in '$ui' - data to fit in the estimation routine in '$data' - control for the estimation routine's control options in '$ui' |
... |
Other arguments provided to 'nlmixr2Est()' provided for flexibility but not currently used inside nlmixr |
Details
Parameters are estimated as follows:
-
ka4 half-lives to Tmax but not higher than 3:log(2)/(tmax/4) -
vcInverse of dose-normalized Cmax -
clEstimated as the median clearance -
vp,vp22- and 4-fold thevc, respectively by default, controlled by thevpMultandvp2Multarguments topkncaControl -
q,q20.5- and 0.25-fold thecl, respectively by default, controlled by theqMultandq2Multarguments topkncaControl
When both intravascular and extravascular doses are present (doses into the
observation compartment are intravascular), ka is estimated from the
extravascular doses and vc and cl are estimated from the
intravascular doses; without extravascular-only doses, ka is not
updated. Intravascular bolus doses have the concentration at the time of
dosing back-extrapolated (replacing a predose concentration at the first
dose), and other doses without a concentration at the time of dosing have it
imputed as the predose concentration (or zero for the first dose).
The bounds for the parameter estimates are set to 10% of the first percentile and 10 times the 99th percentile. (For ka, the lower bound is set to the lower of 10% of the first percentile or 0.03 and the upper bound is not modified from 10 times the 99th percentile.)
Parameter estimation methods may be changed in a future version.
Value
A model with updated starting parameters. In the model a new element named "nca" will be available which includes the PKNCA results used for the calculation.
Control for nlmer estimation method in nlmixr2
Description
Control for nlmer estimation method in nlmixr2
Usage
nlmixr2NlmerControl(
optimizer = "bobyqa",
tolPwrss = NULL,
optCtrl = list(),
returnNlmer = FALSE,
muRefCovAlg = TRUE,
eventSens = c("jump", "fd"),
eventType = c("central", "forward"),
shiErr = (.Machine$double.eps)^(1/3),
shi21maxFD = 20L,
stickyRecalcN = 4,
maxOdeRecalc = 5,
odeRecalcFactor = 10^(0.5),
indTolRelax = TRUE,
useColor = NULL,
printNcol = NULL,
print = 1L,
optExpression = TRUE,
literalFix = TRUE,
sumProd = FALSE,
rxControl = NULL,
calcTables = TRUE,
compress = TRUE,
adjObf = TRUE,
ci = 0.95,
sigdig = 4,
sigdigTable = NULL,
addProp = c("combined2", "combined1"),
...
)
nlmerControl(
optimizer = "bobyqa",
tolPwrss = NULL,
optCtrl = list(),
returnNlmer = FALSE,
muRefCovAlg = TRUE,
eventSens = c("jump", "fd"),
eventType = c("central", "forward"),
shiErr = (.Machine$double.eps)^(1/3),
shi21maxFD = 20L,
stickyRecalcN = 4,
maxOdeRecalc = 5,
odeRecalcFactor = 10^(0.5),
indTolRelax = TRUE,
useColor = NULL,
printNcol = NULL,
print = 1L,
optExpression = TRUE,
literalFix = TRUE,
sumProd = FALSE,
rxControl = NULL,
calcTables = TRUE,
compress = TRUE,
adjObf = TRUE,
ci = 0.95,
sigdig = 4,
sigdigTable = NULL,
addProp = c("combined2", "combined1"),
...
)
Arguments
optimizer |
passed to |
tolPwrss |
passed to |
optCtrl |
a |
returnNlmer |
logical; when |
muRefCovAlg |
logical; when |
eventSens |
method used for the dosing-parameter (alag/F/rate/dur)
sensitivities in the analytic gradient model: |
eventType |
finite-difference type ( |
shiErr |
epsilon used when optimizing the ideal finite-difference step size with the Shi2021 method |
shi21maxFD |
maximum number of Shi2021 step-size optimization iterations for the gradient |
stickyRecalcN |
number of bad ODE solves tolerated before the per-subject tolerance is stickily relaxed |
maxOdeRecalc |
maximum number of times to retry a bad ODE solve with a relaxed tolerance |
odeRecalcFactor |
factor by which atol/rtol are relaxed on an ODE solve retry |
indTolRelax |
when |
useColor |
Logical (or 'NULL') emit ANSI bold/color escapes in the iteration print. 'NULL' (default) defers to [crayon::has_color()]. |
printNcol |
Integer (or 'NULL') parameter columns per row before wrapping. 'NULL' (default) uses 'floor((getOption("width") - 23) / 12)'. |
print |
Either a scalar print-frequency ('0' = suppress, '1' (default) = every evaluation, 'N' = every Nth), OR a pre-built [iterPrintControl()] object. Equivalent to 'iterPrintControl(every = print, ncol = printNcol, useColor = useColor)'. |
optExpression |
Optimize the rxode2 expression to speed up calculation. By default this is turned on. |
literalFix |
boolean, substitute fixed population values as literals and re-adjust ui and parameter estimates after optimization; Default is 'TRUE'. |
sumProd |
Is a boolean indicating if the model should change
multiplication to high precision multiplication and sums to
high precision sums using the PreciseSums package. By default
this is |
rxControl |
'rxode2' ODE solving options during fitting, created with 'rxControl()' |
calcTables |
This boolean is to determine if the foceiFit
will calculate tables. By default this is |
compress |
Should the object have compressed items |
adjObf |
is a boolean to indicate if the objective function
should be adjusted to be closer to NONMEM's default objective
function. By default this is |
ci |
Confidence level for some tables. By default this is 0.95 or 95% confidence. |
sigdig |
Optimization significant digits. One value drives, with a single
consistent formula, the inner/outer optimizer convergence tolerance
( |
sigdigTable |
Significant digits in the final output table. If not specified ('NULL'), it defaults to 'sigdig'. |
addProp |
Type of additive-plus-proportional error: '"combined1"', where standard deviations add:
; or '"combined2"', where variances add:
. Here y = observed, f = predicted, a = additive sd, b = proportional/power sd, c = power exponent (1 in the proportional case). |
... |
Ignored parameters |
Value
nlmer control structure
Author(s)
Matthew L. Fidler
Examples
nlmerControl()
nlmixr2NlmerControl()
This is a S3 method for getting the distribution lines for a base rxode2 saem problem
Description
This is a S3 method for getting the distribution lines for a base rxode2 saem problem
Usage
nmGetDistributionMonolixLines(line)
## S3 method for class 'rxUi'
nmGetDistributionMonolixLines(line)
## S3 method for class 'norm'
nmGetDistributionMonolixLines(line)
Arguments
line |
Parsed rxode2 model environment |
Value
Lines for the estimation of monolix
Author(s)
Matthew Fidler
This is a S3 method for getting the distribution lines for a base rxode2 saem problem
Description
This is a S3 method for getting the distribution lines for a base rxode2 saem problem
Usage
nmGetDistributionNonmemLines(line)
## S3 method for class 'rxUi'
nmGetDistributionNonmemLines(line)
## S3 method for class 'norm'
nmGetDistributionNonmemLines(line)
Arguments
line |
Parsed rxode2 model environment |
Value
Lines for the estimation of nonmem
Author(s)
Matthew Fidler
NONMEM estimation control
Description
NONMEM estimation control
Usage
nonmemControl(
est = c("focei", "imp", "its", "posthoc"),
advanOde = c("advan13", "advan8", "advan6"),
linCmt = c("advan", "ode"),
prune = "auto",
cov = c("r,s", "r", "s", ""),
maxeval = 1e+05,
tol = 6,
atol = 12,
sstol = 6,
ssatol = 12,
sigl = 12,
sigdig = 3,
print = 1,
extension = getOption("babelmixr2.nmModelExtension", ".nmctl"),
outputExtension = getOption("babelmixr2.nmOutputExtension", ".lst"),
runCommand = getOption("babelmixr2.nonmem", ""),
iniSigDig = 5,
protectZeros = FALSE,
protect = getOption("babelmixr2.nmProtect", TRUE),
muRef = TRUE,
addProp = c("combined2", "combined1"),
rxControl = NULL,
sumProd = FALSE,
optExpression = TRUE,
calcTables = TRUE,
compress = TRUE,
ci = 0.95,
sigdigTable = NULL,
readRounding = FALSE,
readBadOpt = FALSE,
niter = 100L,
isample = 1000L,
iaccept = 0.4,
iscaleMin = 0.1,
iscaleMax = 10,
df = 4,
seed = 14456,
mapiter = 1,
mapinter = 0,
noabort = TRUE,
modelName = NULL,
muRefCovAlg = TRUE,
run = TRUE,
...
)
Arguments
est |
NONMEM estimation method: |
advanOde |
The ODE solving method for NONMEM |
linCmt |
How a |
prune |
How |
cov |
The NONMEM covariance method; |
maxeval |
NONMEM's maxeval (for non posthoc methods) |
tol |
NONMEM tolerance for ODE solving advan |
atol |
NONMEM absolute tolerance for ODE solving |
sstol |
NONMEM tolerance for steady state ODE solving |
ssatol |
NONMEM absolute tolerance for steady state ODE solving |
sigl |
NONMEM sigl estimation option |
sigdig |
the significant digits for NONMEM |
print |
The print number for NONMEM |
extension |
NONMEM file extensions |
outputExtension |
Extension to use for the NONMEM output listing |
runCommand |
Command to run NONMEM (typically the path to "nmfe75") or a function. See the details for more information. |
iniSigDig |
How many significant digits are printed in $THETA and $OMEGA when the estimate is zero. Also controls the zero protection numbers |
protectZeros |
Add babelmixr2's own code to protect divide
by zero (and the domains of |
protect |
Add |
muRef |
Automatically mu-reference the control stream |
addProp, sumProd, optExpression, calcTables, compress, ci, sigdigTable |
Passed to |
rxControl |
Options to pass to |
readRounding |
Try to read NONMEM output when NONMEM terminated due to rounding errors |
readBadOpt |
Try to read NONMEM output when NONMEM terminated due to an apparent failed optimization |
niter |
number of iterations in NONMEM estimation methods |
isample |
Isample argument for NONMEM IMP estimation method |
iaccept |
Iaccept for NONMEM IMP estimation method |
iscaleMin |
parameter for IMP NONMEM method (ISCALE_MIN) |
iscaleMax |
parameter for IMP NONMEM method (ISCALE_MAX) |
df |
degrees of freedom for IMP method |
seed |
is the seed for NONMEM methods |
mapiter |
the number of map iterations for IMP method |
mapinter |
is the MAPINTER parameter for the IMP method |
noabort |
Add the |
modelName |
Model name used to generate the NONMEM output. If
|
muRefCovAlg |
This controls if algebraic expressions that can be mu-referenced are treated as mu-referenced covariates by: 1. Creating a internal data-variable 'nlmixrMuDerCov#' for each algebraic mu-referenced expression 2. Change the algebraic expression to 'nlmixrMuDerCov# * mu_cov_theta' 3. Use the internal mu-referenced covariate for saem 4. After optimization is completed, replace 'model()' with old 'model()' expression 5. Remove 'nlmixrMuDerCov#' from nlmix2 output In general, these covariates should be more accurate since it changes the system to a linear compartment model. Therefore, by default this is 'TRUE'. |
run |
Should NONMEM be run (and the files imported to nlmixr2); default is TRUE, but FALSE will simply create the NONMEM control stream and data file. |
... |
optional |
Details
If runCommand is given as a string, it will be called with the
system() command like:
runCommand controlFile outputFile.
For example, if runCommand="'/path/to/nmfe75'" then the command line
used would look like the following:
'/path/to/nmfe75' one.cmt.nmctl one.cmt.lst
If runCommand is given as a function, it will be called as
FUN(ctl, directory, ui) to run NONMEM. This allows you to run NONMEM
in any way that you may need, as long as you can write it in R. babelmixr2
will wait for the function to return before proceeding.
If runCommand is NA, nlmixr() will stop after writing
the model files and without starting NONMEM.
Value
babelmixr2 control option for generating NONMEM control stream and
reading it back into babelmixr2/nlmixr2
Author(s)
Matthew L. Fidler
Examples
nonmemControl()
PKNCA estimation control
Description
PKNCA estimation control
Usage
pkncaControl(
concu = NA_character_,
doseu = NA_character_,
timeu = NA_character_,
volumeu = NA_character_,
vpMult = 2,
qMult = 1/2,
vp2Mult = 4,
q2Mult = 1/4,
dvParam = "cp",
groups = character(),
sparse = FALSE,
ncaData = NULL,
ncaResults = NULL,
rxControl = rxode2::rxControl()
)
Arguments
concu, doseu, timeu |
concentration, dose, and time units from the source
data (passed to |
volumeu |
compartment volume for the model (if |
vpMult, qMult, vp2Mult, q2Mult |
Multipliers for vc and cl to provide initial estimates for vp, q, vp2, and q2 |
dvParam |
The parameter name in the model that should be modified for concentration unit conversions. It must be assigned on a line by itself, separate from the residual error model line. |
groups |
Grouping columns for NCA summaries by group (required if
|
sparse |
Are the concentration-time data sparse PK (commonly used in small nonclinical species or with terminal or difficult sampling) or dense PK (commonly used in clinical studies or larger nonclinical species)? |
ncaData |
Data to use for calculating NCA parameters. Typical use is when a subset of the original data are informative for NCA. |
ncaResults |
Already computed NCA results (a PKNCAresults object) to bypass automatic calculations. At least the following parameters must be calculated in the NCA: cmax.dn, cl.last, and tmax (without tmax, ka is not updated) |
rxControl |
Control options sent to |
Value
A list of parameters
Control for a PopED design task
Description
Control for a PopED design task
Usage
popedControl(
stickyRecalcN = 4,
maxOdeRecalc = 5,
odeRecalcFactor = 10^(0.5),
maxn = NULL,
rxControl = NULL,
sigdig = 4,
important = NULL,
unimportant = NULL,
iFIMCalculationType = c("reduced", "full", "weighted", "loc", "reducedPFIM", "fullABC",
"largeMat", "reducedFIMABC"),
iApproximationMethod = c("fo", "foce", "focei", "foi"),
iFOCENumInd = 1000,
prior_fim = matrix(0, 0, 1),
d_switch = c("d", "ed"),
ofv_calc_type = c("lnD", "d", "a", "Ds", "inverse"),
strEDPenaltyFile = "",
ofv_fun = NULL,
iEDCalculationType = c("mc", "laplace", "bfgs-laplace"),
ED_samp_size = 45,
bLHS = c("hypercube", "random"),
bUseRandomSearch = TRUE,
bUseStochasticGradient = TRUE,
bUseLineSearch = TRUE,
bUseExchangeAlgorithm = FALSE,
bUseBFGSMinimizer = FALSE,
bUseGrouped_xt = FALSE,
EACriteria = c("modified", "fedorov"),
strRunFile = "",
poped_version = NULL,
modtit = "PopED babelmixr2 model",
output_file = "PopED_output_summary",
output_function_file = "PopED_output_",
strIterationFileName = "PopED_current.R",
user_data = NULL,
ourzero = 1e-05,
dSeed = NULL,
line_opta = NULL,
line_optx = NULL,
bShowGraphs = FALSE,
use_logfile = FALSE,
m1_switch = c("central", "complex", "analytic", "ad"),
m2_switch = c("central", "complex", "analytic", "ad"),
hle_switch = c("central", "complex", "ad"),
gradff_switch = c("central", "complex", "analytic", "ad"),
gradfg_switch = c("central", "complex", "analytic", "ad"),
grad_all_switch = c("central", "complex"),
rsit_output = 5,
sgit_output = 1,
hm1 = 1e-05,
hlf = 1e-05,
hlg = 1e-05,
hm2 = 1e-05,
hgd = 1e-05,
hle = 1e-05,
AbsTol = 1e-06,
RelTol = 1e-06,
iDiffSolverMethod = NULL,
bUseMemorySolver = FALSE,
rsit = 300,
sgit = 150,
intrsit = 250,
intsgit = 50,
maxrsnullit = 50,
convergence_eps = 1e-08,
rslxt = 10,
rsla = 10,
cfaxt = 0.001,
cfaa = 0.001,
bGreedyGroupOpt = FALSE,
EAStepSize = 0.01,
EANumPoints = FALSE,
EAConvergenceCriteria = 1e-20,
bEANoReplicates = FALSE,
BFGSProjectedGradientTol = 1e-04,
BFGSTolerancef = 0.001,
BFGSToleranceg = 0.9,
BFGSTolerancex = 0.1,
ED_diff_it = 30,
ED_diff_percent = 10,
line_search_it = 50,
Doptim_iter = 1,
iCompileOption = c("none", "full", "mcc", "mpi"),
compileOnly = FALSE,
iUseParallelMethod = c("mpi", "matlab"),
MCC_Dep = NULL,
strExecuteName = "calc_fim.exe",
iNumProcesses = 2,
iNumChunkDesignEvals = -2,
Mat_Out_Pre = "parallel_output",
strExtraRunOptions = "",
dPollResultTime = 0.1,
strFunctionInputName = "function_input",
bParallelRS = FALSE,
bParallelSG = FALSE,
bParallelMFEA = FALSE,
bParallelLS = FALSE,
groupsize = NULL,
time = "time",
timeLow = "low",
timeHi = "high",
id = "id",
m = NULL,
x = NULL,
ni = NULL,
maxni = NULL,
minni = NULL,
maxtotni = NULL,
mintotni = NULL,
maxgroupsize = NULL,
mingroupsize = NULL,
maxtotgroupsize = NULL,
mintotgroupsize = NULL,
xt_space = NULL,
a = NULL,
maxa = NULL,
mina = NULL,
a_space = NULL,
x_space = NULL,
use_grouped_xt = FALSE,
grouped_xt = NULL,
use_grouped_a = FALSE,
grouped_a = NULL,
use_grouped_x = FALSE,
grouped_x = NULL,
our_zero = NULL,
auto_pointer = "",
user_distribution_pointer = "",
minxt = NULL,
maxxt = NULL,
discrete_xt = NULL,
discrete_a = NULL,
fixRes = FALSE,
script = NULL,
overwrite = TRUE,
literalFix = TRUE,
opt_xt = FALSE,
opt_a = FALSE,
opt_x = FALSE,
opt_samps = FALSE,
optTime = TRUE,
literalFixRes = FALSE,
...
)
Arguments
stickyRecalcN |
The number of bad ODE solves before reducing the atol/rtol for the rest of the problem. |
maxOdeRecalc |
Maximum number of times to reduce the ODE tolerances and try to resolve the system if there was a bad ODE solve. |
odeRecalcFactor |
The ODE recalculation factor when ODE solving goes bad, this is the factor the rtol/atol is reduced |
maxn |
Maximum number of design points for optimization; By
default this is declared by the maximum number of design points
in the babelmixr2 dataset (when |
rxControl |
'rxode2' ODE solving options during fitting, created with 'rxControl()' |
sigdig |
Significant digits used to derive the ODE solver
tolerances when |
important |
character vector of important parameters or NULL for default. This is used with Ds-optimality |
unimportant |
character vector of unimportant parameters or NULL for default. This is used with Ds-optimality |
iFIMCalculationType |
can be either an integer or a named value of the Fisher Information Matrix type:
|
iApproximationMethod |
Approximation method for model, 0=FO, 1=FOCE, 2=FOCEI, 3=FOI |
iFOCENumInd |
integer; number of individuals in focei solve |
prior_fim |
matrix; prior FIM |
d_switch |
integer or character option:
|
ofv_calc_type |
objective calculation type:
|
strEDPenaltyFile |
Penalty function name or path and filename, empty string means no penalty. User defined criterion can be defined this way. |
ofv_fun |
User defined function used to compute the objective function. The function must have a poped database object as its first argument and have "..." in its argument list. Can be referenced as a function or as a file name where the function defined in the file has the same name as the file. e.g. "cost.txt" has a function named "cost" in it. |
iEDCalculationType |
ED Integral Calculation type:
|
ED_samp_size |
Sample size for E-family sampling |
bLHS |
How to sample from distributions in E-family calculations. 0=Random Sampling, 1=LatinHyperCube – |
bUseRandomSearch |
Use random search (1=TRUE, 0=FALSE) |
bUseStochasticGradient |
Use Stochastic Gradient search (1=TRUE, 0=FALSE) |
bUseLineSearch |
Use Line search (1=TRUE, 0=FALSE) |
bUseExchangeAlgorithm |
Use Exchange algorithm (1=TRUE, 0=FALSE) |
bUseBFGSMinimizer |
Use BFGS Minimizer (1=TRUE, 0=FALSE) |
bUseGrouped_xt |
Use grouped time points (1=TRUE, 0=FALSE). |
EACriteria |
Exchange Algorithm Criteria:
|
strRunFile |
Filename and path, or function name, for a run file that is used instead of the regular PopED call. |
poped_version |
The current PopED version |
modtit |
The model title |
output_file |
Filename and path of the output file during search |
output_function_file |
Filename suffix of the result function file |
strIterationFileName |
Filename and path for storage of current optimal design |
user_data |
User defined data structure that, for example could be used to send in data to the model |
ourzero |
Value to interpret as zero in design |
dSeed |
The seed number used for optimization and sampling – integer or -1 which creates a random seed |
line_opta |
Vector for line search on continuous design variables (1=TRUE,0=FALSE) |
line_optx |
Vector for line search on discrete design variables (1=TRUE,0=FALSE) |
bShowGraphs |
Use graph output during search |
use_logfile |
If a log file should be used (0=FALSE, 1=TRUE) |
m1_switch |
Method used to calculate M1:
|
m2_switch |
Method used to calculate M2:
|
hle_switch |
Method used to calculate linearization of residual error:
|
gradff_switch |
Method used to calculate the gradient of the model:
|
gradfg_switch |
Method used to calculate the gradient of the parameter vector g:
|
grad_all_switch |
Method used to calculate all the gradients:
|
rsit_output |
Number of iterations in random search between screen output |
sgit_output |
Number of iterations in stochastic gradient search between screen output |
hm1 |
Step length of derivative of linearized model w.r.t. typical values |
hlf |
Step length of derivative of model w.r.t. g |
hlg |
Step length of derivative of g w.r.t. b |
hm2 |
Step length of derivative of variance w.r.t. typical values |
hgd |
Step length of derivative of OFV w.r.t. time |
hle |
Step length of derivative of model w.r.t. sigma |
AbsTol |
The absolute tolerance for the diff equation solver |
RelTol |
The relative tolerance for the diff equation solver |
iDiffSolverMethod |
The diff equation solver method, NULL as default. |
bUseMemorySolver |
If the differential equation results should be stored in memory (1) or not (0) |
rsit |
Number of Random search iterations |
sgit |
Number of stochastic gradient iterations |
intrsit |
Number of Random search iterations with discrete optimization. |
intsgit |
Number of Stochastic Gradient search iterations with discrete optimization |
maxrsnullit |
Iterations until adaptive narrowing in random search |
convergence_eps |
Stochastic Gradient convergence value, (difference in OFV for D-optimal, difference in gradient for ED-optimal) |
rslxt |
Random search locality factor for sample times |
rsla |
Random search locality factor for covariates |
cfaxt |
Stochastic Gradient search first step factor for sample times |
cfaa |
Stochastic Gradient search first step factor for covariates |
bGreedyGroupOpt |
Use greedy algorithm for group assignment optimization |
EAStepSize |
Exchange Algorithm StepSize |
EANumPoints |
Exchange Algorithm NumPoints |
EAConvergenceCriteria |
Exchange Algorithm Convergence Limit/Criteria |
bEANoReplicates |
Avoid replicate samples when using Exchange Algorithm |
BFGSProjectedGradientTol |
BFGS Minimizer Convergence Criteria Normalized Projected Gradient Tolerance |
BFGSTolerancef |
BFGS Minimizer Line Search Tolerance f |
BFGSToleranceg |
BFGS Minimizer Line Search Tolerance g |
BFGSTolerancex |
BFGS Minimizer Line Search Tolerance x |
ED_diff_it |
Number of iterations in ED-optimal design to calculate convergence criteria |
ED_diff_percent |
ED-optimal design convergence criteria in percent |
line_search_it |
Number of grid points in the line search |
Doptim_iter |
Number of iterations of full Random search and full Stochastic Gradient if line search is not used |
iCompileOption |
Compile options for PopED
When using numbers, option 0,1,2 runs PopED and option 3,4,5 stops after compilation. When using characters, the option |
compileOnly |
logical; only compile the model, do not run
PopED (in conjunction with |
iUseParallelMethod |
Parallel method to use
|
MCC_Dep |
Additional dependencies used in MCC compilation (mat-files), if several space separated |
strExecuteName |
Compilation output executable name |
iNumProcesses |
Number of processes to use when running in parallel (e.g. 3 = 2 workers, 1 job manager) |
iNumChunkDesignEvals |
Number of design evaluations that should be evaluated in each process before getting new work from job manager |
Mat_Out_Pre |
The prefix of the output mat file to communicate with the executable |
strExtraRunOptions |
Extra options send to e$g. the MPI executable or a batch script, see execute_parallel$m for more information and options |
dPollResultTime |
Polling time to check if the parallel execution is finished |
strFunctionInputName |
The file containing the popedInput structure that should be used to evaluate the designs |
bParallelRS |
If the random search is going to be executed in parallel |
bParallelSG |
If the stochastic gradient search is going to be executed in parallel |
bParallelMFEA |
If the modified exchange algorithm is going to be executed in parallel |
bParallelLS |
If the line search is going to be executed in parallel |
groupsize |
Vector defining the size of the different groups (num individuals in each group). If only one number then the number will be the same in every group. |
time |
string that represents the time in the dataset (ie xt) |
timeLow |
string that represents the lower design time (ie minxt) |
timeHi |
string that represents the upper design time (ie maxmt) |
id |
The id variable |
m |
Number of groups in the study. Each individual in a group will have the same design. |
x |
A matrix defining the initial discrete values for the model Each row is a group/individual. |
ni |
Vector defining the number of samples for each group. |
maxni |
Max number of samples per group/individual |
minni |
Min number of samples per group/individual |
maxtotni |
Number defining the maximum number of samples allowed in the experiment. |
mintotni |
Number defining the minimum number of samples allowed in the experiment. |
maxgroupsize |
Vector defining the max size of the different groups (max number of individuals in each group) |
mingroupsize |
Vector defining the min size of the different groups (min num individuals in each group) – |
maxtotgroupsize |
The total maximal groupsize over all groups |
mintotgroupsize |
The total minimal groupsize over all groups |
xt_space |
Cell array |
a |
Matrix defining the initial continuous covariate values. n_rows=number of groups, n_cols=number of covariates. If the number of rows is one and the number of groups > 1 then all groups are assigned the same values. |
maxa |
Vector defining the max value for each covariate. If a single value is supplied then all a values are given the same max value |
mina |
Vector defining the min value for each covariate. If a single value is supplied then all a values are given the same max value |
a_space |
Cell array |
x_space |
Cell array |
use_grouped_xt |
Group sampling times between groups so that each group has the same values ( |
grouped_xt |
Matrix defining the grouping of sample points. Matching integers mean that the points are matched.
Allows for finer control than |
use_grouped_a |
Group continuous design variables between groups so that each group has the same values ( |
grouped_a |
Matrix defining the grouping of continuous design variables. Matching integers mean that the values are matched.
Allows for finer control than |
use_grouped_x |
Group discrete design variables between groups so that each group has the same values ( |
grouped_x |
Matrix defining the grouping of discrete design variables. Matching integers mean that the values are matched.
Allows for finer control than |
our_zero |
Value to interpret as zero in design. |
auto_pointer |
Filename and path, or function name, for the Autocorrelation function, empty string means no autocorrelation |
user_distribution_pointer |
Filename and path, or function name, for user defined distributions for E-family designs |
minxt |
Matrix or single value defining the minimum value for each xt sample. If a single value is supplied then all xt values are given the same minimum value |
maxxt |
Matrix or single value defining the maximum value for each xt sample. If a single value is supplied then all xt values are given the same maximum value. |
discrete_xt |
Cell array |
discrete_a |
Cell array |
fixRes |
boolean; Fix the residuals to what is specified by the model |
script |
write a PopED/rxode2 script that can be modified for more fine control. The default is NULL. When When |
overwrite |
[ |
literalFix |
boolean, substitute fixed population values as literals and re-adjust ui and parameter estimates after optimization; Default is 'TRUE'. |
opt_xt |
boolean to indicate if this is meant for optimizing times |
opt_a |
boolean to indicate if this is meant for optimizing covariates |
opt_x |
boolean to indicate if the discrete design variables be optimized |
opt_samps |
boolean to indicate if the sample optimizer is
used (not implemented yet in |
optTime |
boolean to indicate if the global time indexer
inside of babelmixr2 is reset if the times are different. By
default this is |
literalFixRes |
boolean, substitute fixed population values as literals and re-adjust ui and parameter estimates after optimization; Default is 'TRUE'. |
... |
other parameters for PopED control |
Value
popedControl object
Author(s)
Matthew L. Fidler
References
Fidler ML, Denney W, Harrold J, Hooijmaijers R, Papathanasiou T, Schoemaker R, Taubert M, Trame M, Wilkins J (2024). babelmixr2 and PopED: Quick Conversion of NONMEM, Monolix and nlmixr2/rxode2 Models to PopED Optimal Design Analysis. American Conference on Pharmacometrics (ACoP) 2024. doi:10.70534/XUMG6226
Get Multiple Endpoint Modeling Times
Description
This function takes a vector of times and a corresponding vector of IDs, groups the times by their IDs, initializes an internal C++ global TimeIndexer, that is used to efficiently lookup the final output from the rxode2 solve and then returns the sorted unique times.
The popedMultipleEndpointIndexDataFrame() function can be used
to visualize the internal data structure inside R, but it does
not show all the indexes in the case of time ties for a given
ID. Rather it shows one of the indexs and the total number of
indexes in the data.frame
Usage
popedGetMultipleEndpointModelingTimes(times, modelSwitch, sorted = FALSE)
popedMultipleEndpointIndexDataFrame(print = FALSE)
Arguments
times |
A numeric vector of times. |
modelSwitch |
An integer vector of model switch indicator corresponding to the times |
sorted |
A boolean indicating if the returned times should be sorted |
print |
boolean for |
Value
A numeric vector of unique times.
Examples
times <- c(1.1, 1.2, 1.3, 2.1, 2.2, 3.1)
modelSwitch <- c(1, 1, 1, 2, 2, 3)
sortedTimes <- popedGetMultipleEndpointModelingTimes(times, modelSwitch, TRUE)
print(sortedTimes)
# now show the output of the data frame representing the model
# switch to endpoint index
popedMultipleEndpointIndexDataFrame()
# now show a more complex example with overlaps etc.
times <- c(1.1, 1.2, 1.3, 0.5, 2.2, 1.1, 0.75,0.75)
modelSwitch <- c(1, 1, 1, 2, 2, 2, 3, 3)
sortedTimes <- popedGetMultipleEndpointModelingTimes(times, modelSwitch, TRUE)
print(sortedTimes)
popedMultipleEndpointIndexDataFrame(TRUE) # Print to show individual matching
Populates Multiple Endpoint Parameters for internal solving
Description
This function populates a numeric vector with parameters and unique times and also populates the internal C++ global index
Usage
popedMultipleEndpointParam(p, times, modelSwitch, maxMT, optTime = TRUE)
Arguments
p |
A numeric vector of parameters |
times |
A numeric vector of times |
modelSwitch |
An integer vector indicating model switches from PopED |
maxMT |
An integer specifying the maximum number of time points in the mtimes model |
Details
This function first uses the input times and model switches to a global time indexer.
It then creates a new numeric vector that combines the input parameters and unique times. If the number of times is less than
maxMT, the remaining elements are filled with the maximum time.
Value
A numeric vector containing the parameters followed by unique times, if the maximum number of times is greater than the input this will append the maximum observed times in the input. This assumes the first parameter is the id and is dropped fro the output.
Author(s)
Matthew L. Fidler
Examples
p <- c(1.0, 2.0, 3.0)
times <- c(0.5, 1.5, 2.5)
modelSwitch <- c(1, 2, 3)
maxMT <- 5
popedMultipleEndpointParam(p, times, modelSwitch, maxMT)
Reset the Global Time Indexer for Multiple Endpoint Modeling
Description
This clears the memory and resets the global time indexer used for multiple endpoint modeling.
Usage
popedMultipleEndpointResetTimeIndex()
Value
NULL, called for side effects
Examples
popedMultipleEndpointResetTimeIndex()
Control for fmeMcmc estimation method in nlmixr2
Description
Control for fmeMcmc estimation method in nlmixr2
Usage
pseudoOptimControl(
npop = NULL,
numiter = 10000,
centroid = 3,
varleft = NULL,
verbose = FALSE,
returnPseudoOptim = FALSE,
stickyRecalcN = 4,
maxOdeRecalc = 5,
odeRecalcFactor = 10^(0.5),
indTolRelax = TRUE,
useColor = NULL,
printNcol = NULL,
print = 1L,
normType = c("rescale2", "mean", "rescale", "std", "len", "constant"),
scaleType = c("none", "nlmixr2", "norm", "mult", "multAdd"),
scaleCmax = 1e+05,
scaleCmin = 1e-05,
scaleC = NULL,
scaleTo = 1,
rxControl = NULL,
optExpression = TRUE,
sumProd = FALSE,
literalFix = TRUE,
literalFixRes = TRUE,
addProp = c("combined2", "combined1"),
calcTables = TRUE,
compress = TRUE,
covMethod = c("r", ""),
adjObf = TRUE,
ci = 0.95,
sigdig = 4,
sigdigTable = NULL,
eventSens = c("jump", "fd"),
...
)
Arguments
npop |
Number of elements in the population. Defaults to max(5*length(p),50) which is calculated from the number of parameters in the model |
numiter |
Number of iterations to run the optimization.
Defaults to 10000. The algorithm either stops when |
centroid |
Number of elements from which to estimate a new parameter vector. The default is 3. |
varleft |
relative variation remaining; if below this value, the
algorithm stops. When |
verbose |
If TRUE, print information about the optimization
from |
returnPseudoOptim |
return the pseudoOptim output instead of the nlmixr2 fit |
stickyRecalcN |
The number of bad ODE solves before reducing the atol/rtol for the rest of the problem. |
maxOdeRecalc |
Maximum number of times to reduce the ODE tolerances and try to resolve the system if there was a bad ODE solve. |
odeRecalcFactor |
The ODE recalculation factor when ODE solving goes bad, this is the factor the rtol/atol is reduced |
indTolRelax |
when |
useColor |
Logical (or 'NULL') emit ANSI bold/color escapes in the iteration print. 'NULL' (default) defers to [crayon::has_color()]. |
printNcol |
Integer (or 'NULL') parameter columns per row before wrapping. 'NULL' (default) uses 'floor((getOption("width") - 23) / 12)'. |
print |
Either a scalar print-frequency ('0' = suppress, '1' (default) = every evaluation, 'N' = every Nth), OR a pre-built [iterPrintControl()] object. Equivalent to 'iterPrintControl(every = print, ncol = printNcol, useColor = useColor)'. |
normType |
Parameter normalization/scaling used to get scaled
initial values for |
scaleType |
The scaling scheme for nlmixr2: |
scaleCmax |
Maximum value of the scaleC to prevent overflow. |
scaleCmin |
Minimum value of the scaleC to prevent underflow. |
scaleC |
Scaling constant used with |
scaleTo |
Scale the initial parameter estimate to this value. By default this is 1. When zero or below, no scaling is performed. |
rxControl |
'rxode2' ODE solving options during fitting, created with 'rxControl()' |
optExpression |
Optimize the rxode2 expression to speed up calculation. By default this is turned on. |
sumProd |
Is a boolean indicating if the model should change
multiplication to high precision multiplication and sums to
high precision sums using the PreciseSums package. By default
this is |
literalFix |
boolean, substitute fixed population values as literals and re-adjust ui and parameter estimates after optimization; Default is 'TRUE'. |
literalFixRes |
boolean, substitute fixed population values as literals and re-adjust ui and parameter estimates after optimization; Default is 'TRUE'. |
addProp |
Type of additive-plus-proportional error: '"combined1"', where standard deviations add:
; or '"combined2"', where variances add:
. Here y = observed, f = predicted, a = additive sd, b = proportional/power sd, c = power exponent (1 in the proportional case). |
calcTables |
This boolean is to determine if the foceiFit
will calculate tables. By default this is |
compress |
Should the object have compressed items |
covMethod |
Method for calculating the covariance. |
adjObf |
is a boolean to indicate if the objective function
should be adjusted to be closer to NONMEM's default objective
function. By default this is |
ci |
Confidence level for some tables. By default this is 0.95 or 95% confidence. |
sigdig |
Optimization significant digits. One value drives, with a single
consistent formula, the inner/outer optimizer convergence tolerance
( |
sigdigTable |
Significant digits in the final output table. If not specified ('NULL'), it defaults to 'sigdig'. |
eventSens |
method used for the dosing-parameter (alag/F/rate/dur)
sensitivities: |
... |
Ignored parameters |
Value
pseudoOptim control structure
Author(s)
Matthew L. Fidler
Examples
# A logit regression example with emax model
dsn <- data.frame(i=1:1000)
dsn$time <- exp(rnorm(1000))
dsn$DV=rbinom(1000,1,exp(-1+dsn$time)/(1+exp(-1+dsn$time)))
mod <- function() {
ini({
# This estimation method requires all parameters
# to be bounded:
E0 <- c(-100, 0.5, 100)
Em <- c(0, 0.5, 10)
E50 <- c(0, 2, 20)
g <- fix(c(0.1, 2, 10))
})
model({
v <- E0+Em*time^g/(E50^g+time^g)
ll(bin) ~ DV * v - log(1 + exp(v))
})
}
fit2 <- nlmixr(mod, dsn, est="pseudoOptim")
print(fit2)
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
- lotri
- magrittr
- monolix2rx
mlxtran(),mlxtran(),monolix2rx(),monolix2rx(),monolix2rx()- nlmixr2est
.nlmixrNlmeFun(),ACF,addCwres(),addNpde(),addTable(),augPred,bobyqaControl(),fixed.effects,fixef,foceiControl(),getData,getValidNlmixrCtl(),getValidNlmixrCtl(),getVarCov,groupedData,iterPrintControl(),lbfgsb3cControl(),n1qn1Control(),newuoaControl(),nlmControl(),nlme,nlmeControl(),nlminbControl(),nlmixr(),nlmixr2(),nlmixr2(),nlmixr2AllEst(),nlmixr2Est(),nlmixr2Est(),nlmixr2NlmeControl(),nlsControl(),nmObjGetControl(),nmObjGetControl(),nmObjGetFoceiControl(),nmObjGetFoceiControl(),nmObjHandleControlObject(),nmObjHandleControlObject(),optimControl(),pdBlocked,pdCompSymm,pdConstruct,pdDiag,pdFactor,pdIdent,pdLogChol,pdMat,pdMatrix,pdNatural,pdSymm,random.effects,ranef,reStruct,saemControl(),setOfv(),tableControl(),uobyqaControl(),varComb,varConstPower,VarCorr,varExp,varFixed,varFunc,varIdent,varPower,varWeights,vpcSim()- nlmixr2extra
bootplot(),bootstrapFit(),preconditionFit(),profileFixed(),profileFixedSingle(),profileLlp()- nlmixr2plot
traceplot(),vpcCens(),vpcCensTad(),vpcPlot(),vpcPlotTad()- nonmem2rx
as.nonmem2rx(),as.nonmem2rx(),nmcov(),nmcov(),nmcov(),nmext(),nmext(),nminfo(),nminfo(),nmtab(),nmtab(),nmxml(),nmxml(),nonmem2rx(),nonmem2rx()- rxode2
.minfo(),.minfo(),add.dosing(),add.sampling(),et(),et(),etExpand(),eventTable(),expit(),geom_amt(),geom_cens(),ini(),ini<-(),logit(),lotri,model(),model<-(),probit(),probitInv(),rxCat(),rxClean(),rxControl(),rxDerived(),rxFun(),rxModelVars(),rxModelVars(),rxode(),RxODE(),rxode2(),rxParam(),rxParams(),rxSetPipingAuto(),rxSetSeed(),rxSolve(),rxUiGet(),rxUiGet(),stat_amt(),stat_cens()
Convert RxODE syntax to monolix syntax
Description
Convert RxODE syntax to monolix syntax
Usage
rxToMonolix(x, ui)
Arguments
x |
Expression |
ui |
rxode2 ui |
Value
Monolix syntax
Author(s)
Matthew Fidler
Convert RxODE syntax to NONMEM syntax
Description
Convert RxODE syntax to NONMEM syntax
Usage
rxToNonmem(x, ui)
Arguments
x |
Expression |
ui |
rxode2 ui |
Value
NONMEM syntax
Author(s)
Matthew Fidler
Load pruned nlmer model into symengine (no sensitivity promotion)
Description
Load pruned nlmer model into symengine (no sensitivity promotion)
Usage
## S3 method for class 'loadPruneNlmer'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
Load pruned nlmer model into symengine (with sensitivity promotion)
Description
Load pruned nlmer model into symengine (with sensitivity promotion)
Usage
## S3 method for class 'loadPruneNlmerSens'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
Full nlmer symengine environment with sensitivities
Description
Full nlmer symengine environment with sensitivities
Usage
## S3 method for class 'nlmerEnv'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
Build the full 3-part nlmer formula
Description
Build the full 3-part nlmer formula
Usage
## S3 method for class 'nlmerFormula'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
Value
3-part formula for lme4::nlmer
Compute d(f)/d(THETA[i]) for all nlmer parameters
Description
Compute d(f)/d(THETA[i]) for all nlmer parameters
Usage
## S3 method for class 'nlmerHdTheta'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
nlmer base model (saem-dropped etas, THETA[i] prefix, nlme error lines)
Description
nlmer base model (saem-dropped etas, THETA[i] prefix, nlme error lines)
Usage
## S3 method for class 'nlmerModel0'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
params() string for the nlmer THETA[i]-indexed model
Description
params() string for the nlmer THETA[i]-indexed model
Usage
## S3 method for class 'nlmerParams'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
Build the random-effects part (part 3) of the nlmer 3-part formula
Description
Build the random-effects part (part 3) of the nlmer 3-part formula
Usage
## S3 method for class 'nlmerRandomFormula'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
Value
Formula: param1 + param2 + ... + (rand1 + rand2 | ID)
Compiled nlmer sensitivity model (prediction + gradients)
Description
Returns a list with:
-
thetaGrad: compiled rxode2 model computing rx_pred_ and rx__sens_rx_pred__BY_THETA_i___ for each estimated parameter. WheneventSens = "jump"this model carries rxode2's analytic event-jump sensitivities (loaded/activated bynlmixr2est::.nlmSetupEnv()). -
predOnly: compiled rxode2 model for prediction only -
eventTheta: integer vector flaggingTHETA[i]that need Shi2021 finite differences for dosing parameters (all 0 undereventSens = "jump") -
paramNames: character vector of parameter names inTHETA[i]order
Usage
## S3 method for class 'nlmerSensModel'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
Details
The list follows the modelInfo contract of nlmixr2est::.nlmSetupEnv()
so the nlm C machinery can load it once and keep it resident.
Starting values for nlmer fixed effects
Description
Starting values for nlmer fixed effects
Usage
## S3 method for class 'nlmerStart'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
Value
Named numeric vector: iniDf estimates for thetas, 0 for nonMuEtas
Compute d(state)/d(THETA[i]) sensitivities for nlmer
Description
Compute d(state)/d(THETA[i]) sensitivities for nlmer
Usage
## S3 method for class 'nlmerThetaS'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
Get the structural params to estimate for nlmer (= saemParamsToEstimate)
Description
Get the structural params to estimate for nlmer (= saemParamsToEstimate)
Usage
## S3 method for class 'nlmerThetas'
rxUiGet(x, ...)
Arguments
x |
rxUiGet list(ui) |
... |
additional arguments (currently ignored) |
Value
Character vector of parameter names (mu-ref thetas + nonMuEtas)
Control for saemix estimation method in nlmixr2
Description
Control for saemix estimation method in nlmixr2
Usage
saemixControl(
map = TRUE,
fim = TRUE,
ll.is = TRUE,
ll.gq = FALSE,
nbiter.saemix = c(300, 100),
nbiter.sa = NA,
nbiter.burn = 5,
nbiter.map = 5,
nb.chains = 1,
fix.seed = TRUE,
seed = 23456,
nmc.is = 5000,
nu.is = 4,
print.is = FALSE,
nbdisplay = 100,
displayProgress = FALSE,
print = FALSE,
save = FALSE,
save.graphs = TRUE,
directory = "newdir",
warnings = FALSE,
nbiter.mcmc = c(2, 2, 2, 0),
proba.mcmc = 0.4,
stepsize.rw = 0.4,
rw.init = 0.5,
alpha.sa = 0.97,
nnodes.gq = 12,
nsd.gq = 4,
maxim.maxiter = 100,
nb.sim = 1000,
nb.simpred = 100,
ipar.lmcmc = 50,
ipar.rmcmc = 0.05,
rxControl = NULL,
stickyRecalcN = 4,
maxOdeRecalc = 5,
odeRecalcFactor = 10^(0.5),
indTolRelax = TRUE,
eventSens = c("jump", "fd"),
useColor = NULL,
printNcol = NULL,
normType = c("rescale2", "mean", "rescale", "std", "len", "constant"),
scaleType = c("none", "nlmixr2", "norm", "mult", "multAdd"),
scaleCmax = 1e+05,
scaleCmin = 1e-05,
scaleC = NULL,
scaleTo = 1,
addProp = c("combined2", "combined1"),
calcTables = TRUE,
compress = TRUE,
ci = 0.95,
sigdigTable = NULL,
sigdig = 4,
...
)
Arguments
map |
logical, whether to compute MAP estimates (default |
fim |
logical, whether to compute FIM (default |
ll.is |
logical, whether to compute log-likelihood by Importance Sampling (default |
ll.gq |
logical, whether to compute log-likelihood by Gaussian Quadrature (default |
nbiter.saemix |
integer vector of length 2, number of iterations for phase 1 (exploratory) and phase 2 (smoothing) of SAEM (default |
nbiter.sa |
number of iterations for simulated annealing (default |
nbiter.burn |
number of iterations for burn-in (default |
nbiter.map |
number of iterations for MAP estimation (default |
nb.chains |
number of chains (default |
fix.seed |
logical, whether to fix the random seed (default |
seed |
random seed (default |
nmc.is |
number of Monte Carlo samples for Importance Sampling (default |
nu.is |
number of degrees of freedom for the student distribution in Importance Sampling (default |
print.is |
logical, whether to print progress during Importance Sampling (default |
nbdisplay |
number of iterations between progress displays (default |
displayProgress |
logical, whether to display graphical progress (default |
print |
whether |
save |
logical, whether to save results to files (default |
save.graphs |
logical, whether to save graphs (default |
directory |
directory where results and graphs are saved (default |
warnings |
logical, whether to show warnings (default |
nbiter.mcmc |
integer vector of length 4, number of iterations for MCMC kernel updates (default |
proba.mcmc |
probability for MCMC kernel selection (default |
stepsize.rw |
stepsize for random walk kernel (default |
rw.init |
initial standard deviation for random walk kernel (default |
alpha.sa |
parameter for simulated annealing (default |
nnodes.gq |
number of nodes for Gaussian Quadrature (default |
nsd.gq |
number of standard deviations for Gaussian Quadrature (default |
maxim.maxiter |
maximum number of iterations for maximization step (default |
nb.sim |
number of simulations for visual predictive check (default |
nb.simpred |
number of simulations for predictions (default |
ipar.lmcmc |
parameter for L-MCMC (default |
ipar.rmcmc |
parameter for R-MCMC (default |
rxControl |
'rxode2' ODE solving options during fitting, created with 'rxControl()' |
stickyRecalcN |
The number of bad ODE solves before reducing the atol/rtol for the rest of the problem. |
maxOdeRecalc |
Maximum number of times to reduce the ODE tolerances and try to resolve the system if there was a bad ODE solve. |
odeRecalcFactor |
The ODE recalculation factor when ODE solving goes bad, this is the factor the rtol/atol is reduced |
indTolRelax |
when |
eventSens |
method used for the dosing-parameter (alag/F/rate/dur)
sensitivities when the final tables are built: |
useColor |
Logical (or 'NULL') emit ANSI bold/color escapes in the iteration print. 'NULL' (default) defers to [crayon::has_color()]. |
printNcol |
Integer (or 'NULL') parameter columns per row before wrapping. 'NULL' (default) uses 'floor((getOption("width") - 23) / 12)'. |
normType |
Parameter normalization/scaling used to get scaled
initial values for |
scaleType |
The scaling scheme for nlmixr2: |
scaleCmax |
Maximum value of the scaleC to prevent overflow. |
scaleCmin |
Minimum value of the scaleC to prevent underflow. |
scaleC |
Scaling constant used with |
scaleTo |
Scale the initial parameter estimate to this value. By default this is 1. When zero or below, no scaling is performed. |
addProp |
Type of additive-plus-proportional error: '"combined1"', where standard deviations add:
; or '"combined2"', where variances add:
. Here y = observed, f = predicted, a = additive sd, b = proportional/power sd, c = power exponent (1 in the proportional case). |
calcTables |
This boolean is to determine if the foceiFit
will calculate tables. By default this is |
compress |
Should the object have compressed items |
ci |
Confidence level for some tables. By default this is 0.95 or 95% confidence. |
sigdigTable |
Significant digits in the final output table. If not specified ('NULL'), it defaults to 'sigdig'. |
sigdig |
Optimization significant digits. One value drives, with a single
consistent formula, the inner/outer optimizer convergence tolerance
( |
... |
Ignored parameters |
Value
saemix control structure
Author(s)
Matthew L. Fidler
Examples
# Example showing control creation:
ctrl <- saemixControl(seed = 123456)
Simplify units by removing repeated units from the numerator and denominator
Description
Simplify units by removing repeated units from the numerator and denominator
Usage
simplifyUnit(numerator = "", denominator = "")
Arguments
numerator |
The numerator of the units (or the whole unit specification) |
denominator |
The denominator of the units (or NULL if |
Details
NA or "" for numerator and denominator
are considered unitless.
Value
The units specified with units that are in both the numerator and denominator cancelled.
See Also
Other Unit conversion:
modelUnitConversion()
Examples
simplifyUnit("kg", "kg/mL")
# units that don't match exactly are not cancelled
simplifyUnit("kg", "g/mL")