Skip to contents

For an rxode2 model specification (rxUi) there are no realized random effects (etas), so coef() returns the fixed-effect (theta) estimates by default. The random-effect variability matrix (omega) can be requested with level="omega", or both can be returned together with level="all".

Usage

# S3 method for class 'rxUi'
coef(
  object,
  level = c("theta", "fixed", "omega", "random", "all", "both"),
  ...
)

# S3 method for class '`function`'
coef(
  object,
  level = c("theta", "fixed", "omega", "random", "all", "both"),
  ...
)

Arguments

object

rxode2 ui model or a function that evaluates to one

level

which coefficients to return: "theta"/"fixed" (the default) returns the named fixed-effect estimates; "omega"/"random" returns the random-effect variability matrix (or NULL when the model has no random effects); "all"/"both" returns a list with theta and omega.

...

other parameters (currently ignored)

Value

depends on level: a named numeric vector of fixed effects, the omega matrix (or NULL), or a list with both theta and omega.

Author

Matthew L. Fidler

Examples

one.compartment <- function() {
  ini({
    tka <- 0.45
    tcl <- 1
    tv <- 3.45
    eta.ka ~ 0.6
  })
  model({
    ka <- exp(tka + eta.ka)
    cl <- exp(tcl)
    v <- exp(tv)
    d/dt(depot) <- -ka * depot
    d/dt(center) <- ka * depot - cl / v * center
    cp <- center / v
  })
}

ui <- one.compartment()
coef(ui)
#>  tka  tcl   tv 
#> 0.45 1.00 3.45 
coef(ui, level="omega")
#>        eta.ka
#> eta.ka    0.6
coef(ui, level="all")
#> $theta
#>  tka  tcl   tv 
#> 0.45 1.00 3.45 
#> 
#> $omega
#>        eta.ka
#> eta.ka    0.6
#>