Specifies the initial values, lower bounds, upper bounds, and units for fixed effects in a model
fixedEffect.RdBuilt-in-model structural setter for fixed-effect (theta) initials, bounds,
freeze status, and units. Use during model construction when units are
needed, or when configuring several thetas together as part of setup.
Cannot be used on textual or edited models; for pipe-friendly value,
bounds, and freeze edits on built-in or textual models, see
update_Thetas() (textual models also support enable; neither API sets
units except this one).
Usage
fixedEffect(
.Object,
effect,
value = NULL,
lowerBound = NULL,
upperBound = NULL,
isFrozen = NULL,
unit = NULL
)Arguments
- .Object
Model object in which to define fixed effects values
- effect
Character or character vector specifying names of fixed effects
- value
Numeric or numeric vector specifying the initial values of fixed effects. If supplying vector, must be in the same order/length as corresponding
effect.- lowerBound
Numeric or numeric vector specifying the lower limit values of fixed effects. If supplying vector, must be in the same order as
effect.- upperBound
Numeric or numeric vector specifying the upper limit values of fixed effects. If supplying vector, must be in the same order as
effect.- isFrozen
Logical or logical vector. Set to
TRUEto freeze the fixed effect to the specified initial value. If supplying vector, must be in the same order aseffect.- unit
Character or character vector specifying units of measurement for the fixed effects. If supplying a vector, must be in the same order as
effect.
Examples
model <- pkmodel(
numCompartments = 2,
data = pkData,
ID = "Subject",
Time = "Act_Time",
A1 = "Amount",
CObs = "Conc",
modelName = "TwCpt_IVBolus_FOCE_ELS",
workingDir = tempdir()
)
# View initial/current fixed effect values
initFixedEffects(model)
#> tvV tvCl tvV2 tvCl2
#> "1" "1" "1" "1"
model <-
fixedEffect(
model,
effect = c("tvV", "tvCl", "tvV2", "tvCl2"),
value = c(15, 5, 40, 15)
)