Skip to contents

Built-in-model structural setter for the covariance matrix of random effects (omegas). Use when defining or changing diagonal vs. block membership (which etas belong to a section), together with initial values and section freeze status. Cannot be used on textual or edited models.

Usage

randomEffect(
  .Object,
  effect,
  value = NULL,
  isDiagonal = TRUE,
  isFrozen = FALSE,
  ...
)

Arguments

.Object

Model object

effect

One or more names of available random effects.

value

Initial values for the diagonal elements of the covariance matrix of random effects (if isDiagonal = TRUE, or initial values for the lower triangular elements (including diagonal elements) of the covariance matrix (if isDiagonal = FALSE) in a row-wise order.

isDiagonal

Set to TRUE to if the covariance matrix of the specified random effects is a diagonal matrix. or FALSE if not.

isFrozen

Set to TRUE to freeze the covariance matrix of random effects.

...

Additional arguments

Value

Modified NlmePmlModel object

Details

For value or freeze edits that keep an existing built-in section layout, see update_Omegas(). That updater also supports textual models for value/matrix edits through TDL5 (no freeze/unfreeze; frozen or same()-linked sections may reject edits; textual topology may be normalized – see update_Omegas()).

See also

Examples

model <- pkmodel(
  numCompartments = 2,
  data = pkData,
  ID = "Subject",
  Time = "Act_Time",
  A1 = "Amount",
  CObs = "Conc",
  modelName = "TwCpt_IVBolus_FOCE_ELS",
  workingDir = tempdir()
  )

model <-
  randomEffect(model,
               effect = c("nV", "nCl", "nCl2"), value = rep(0.1, 3))