Calls out to bbi and returns a named list of class bbi_{.model_type}_summary with model outputs and diagnostics.

model_summary(
  .mod,
  .model_type = NULL,
  .bbi_args = NULL,
  ...,
  .dry_run = FALSE,
  .directory = NULL
)

# S3 method for bbi_nonmem_model
model_summary(
  .mod,
  .model_type = NULL,
  .bbi_args = NULL,
  ...,
  .dry_run = FALSE,
  .directory = NULL
)

# S3 method for character
model_summary(
  .mod,
  .model_type = c("nonmem", "stan"),
  .bbi_args = NULL,
  ...,
  .dry_run = FALSE,
  .directory = get_model_directory()
)

# S3 method for numeric
model_summary(
  .mod,
  .model_type = c("nonmem", "stan"),
  .bbi_args = NULL,
  ...,
  .dry_run = FALSE,
  .directory = get_model_directory()
)

Arguments

.mod

Model to summarize. Can be a bbi_{.model_type}_model object, a file path, or an integer corresponding to a file path.

.model_type

String specifying the type of model, either 'nonmem' or 'stan'. Only used when passing a path for .mod instead of a bbi_{.model_type}_model object.

.bbi_args

A named list specifying arguments to pass to babylon formatted like list("nm_version" = "nm74gf_nmfe", "json" = T, "threads" = 4).

...

args passed through to bbi_exec()

.dry_run

show what the command would be without actually running it

.directory

Model directory which .mod path is relative to. Defaults to options('rbabylon.model_directory'), which can be set globally with set_model_directory(). Only used when passing a path for .mod instead of a bbi_{.model_type}_model object.

Details

NONMEM

The returned list for a NONMEM model will contain the following top-level elements:

  • run_details

  • run_heuristics

  • parameters_data

  • parameter_names

  • ofv

  • shrinkage_details

  • covariance_theta

  • correlation_theta

The summary call will error if it does not find certain files in the output folder. However, you can override this behavior with the following file-specific flags:

  • no_cor_file

  • no_cov_file

  • no_ext_file

  • no_grd_file

  • no_shk_file

If you are using an estimation method that does not produce any of the following files, or they are missing for some other legitimate reason, pass the appropriate flags through the .bbi_args argument. For example, if have asked to skip the $COV step, you would call model_summary(..., .bbi_args = list(no_cov_file = TRUE)).

Methods (by class)

  • bbi_nonmem_model: Get model summary from bbi_nonmem_model object

  • character: Get model summary from output directory path

  • numeric: Get model summary from numeric input. This will only work if you are calling from the same directory as the models, or if you have set options('rbabylon.model_directory') to the directory constaining the relevant model.