Skip to contents

Tidy/pipe-friendly updater for residual-error standard deviations (sigmas). Complements residualError(), which remains the built-in structural setter for changing error type, BQL/LLOQ, or power configuration.

Usage

update_Sigmas(model, ..., freeze = NULL, unfreeze = NULL)

Arguments

model

Model object (built-in or textual)

...

Named sigma specs keyed by epsilon or observation name; see Details

freeze

Character vector of epsilon/observation names to freeze. Applicable to built-in models only.

unfreeze

Character vector of epsilon/observation names to unfreeze. Applicable to built-in models only.

Value

Modified NlmePmlModel object

Details

For built-in models, the standard deviation of the residual error (SD) can be edited, and it can also be frozen or unfrozen through the freeze=/unfreeze= arguments (or by specifying freeze in a named spec). These edits do not change the error type. For textual models, SD edits go through TDL5 override; freeze and unfreeze are not supported and raise an error. In addition, a residual error whose error() statement declares freeze cannot be updated and raises an error.

Each named argument in ... identifies a residual error by either its epsilon name (e.g. CEps) or its observation name (e.g. CObs). The argument can be given as either a scalar value (the initial SD) or a named vector spec that defines the initial SD (initial, alias value) and whether the SD is frozen (freeze, alias frozen). Observation names are resolved on built-in models only: a built-in model stores an observation alongside its epsilon, whereas linking the two on a textual model would require parsing the observe() statement, so textual models must be keyed by epsilon name.

The fixed effect corresponding to the proportional component of AdditiveMultiplicative/MixRatio error models (e.g. CMultStdev) is a regular fixed effect and should be updated with update_Thetas() rather than this function.

See also

Examples

model <- pkmodel(columnMap = FALSE, workingDir = tempdir())
model <- update_Sigmas(model, CEps = c(initial = 0.05, freeze = TRUE))