Skip to contents

Assert properties of the rxUi models

Usage

assertRxUi(model, extra = "", .var.name = .vname(model))

assertRxUiPrediction(model, extra = "", .var.name = .vname(model))

assertRxUiSingleEndpoint(model, extra = "", .var.name = .vname(model))

assertRxUiTransformNormal(model, extra = "", .var.name = .vname(model))

assertRxUiNormal(model, extra = "", .var.name = .vname(model))

assertRxUiMuRefOnly(model, extra = "", .var.name = .vname(model))

assertRxUiEstimatedResiduals(model, extra = "", .var.name = .vname(model))

assertRxUiPopulationOnly(model, extra = "", .var.name = .vname(model))

assertRxUiMixedOnly(model, extra = "", .var.name = .vname(model))

assertRxUiRandomOnIdOnly(model, extra = "", .var.name = .vname(model))

Arguments

model

Model to check

extra

Extra text to append to the error message (like "for focei")

.var.name

[character(1)]
Name of the checked object to print in assertions. Defaults to the heuristic implemented in vname.

Value

the rxUi model

Details

These functions have different types of assertions

  • assertRxUi -- Make sure this is a proper rxode2 model (if not throw error)

  • assertRxUiSingleEndpoint -- Make sure the rxode2 model is only a single endpoint model (if not throw error)

  • assertRxUiTransformNormal -- Make sure that the model residual distribution is normal or transformably normal

  • assertRxUiNormal -- Make sure that the model residual distribution is normal

  • assertRxUiEstimatedResiduals -- Make sure that the residual error parameters are estimated (not modeled).

  • assertRxUiPopulationOnly -- Make sure the model is the population only model (no mixed effects)

  • assertRxUiMixedOnly -- Make sure the model is a mixed effect model (not a population effect, only)

  • assertRxUiPrediction -- Make sure the model has predictions

  • assertRxUiMuRefOnly -- Make sure that all the parameters are mu-referenced

  • assertRxUiRandomOnIdOnly -- Make sure there are only random effects at the ID level

Author

Matthew L. Fidler

Examples


# \donttest{
one.cmt <- function() {
 ini({
   tka <- 0.45; label("Ka")
   tcl <- log(c(0, 2.7, 100)); label("Cl")
   tv <- 3.45; label("V")
   eta.ka ~ 0.6
   eta.cl ~ 0.3
   eta.v ~ 0.1
   add.sd <- 0.7
 })
 model({
   ka <- exp(tka + eta.ka)
   cl <- exp(tcl + eta.cl)
   v <- exp(tv + eta.v)
   linCmt() ~ add(add.sd)
 })
}

assertRxUi(one.cmt)
#>  
#>  
# assertRxUi(rnorm) # will fail

assertRxUiSingleEndpoint(one.cmt)
#>  
#>  
# }