Extend a run log with a "dofv" column that reports the difference in objective function value between the row's model and a reference model.

add_dofv(.log_df, .mod_ref = NULL)

Arguments

.log_df

A bbi_run_log_df tibble (as output by run_log() or summary_log()).

.mod_ref

The reference model to use when calculating the change in objective function value for each model in the run log. By default, the reference model is each model's parent (as identified by the first item returned by get_based_on()). Pass a bbi_nonmem_model object to use its objective function value as the reference value for all calculations.

Value

The .log_df data frame with a new "dofv" column. If .log_df is not a summary log, an "ofv" column is also added for context.

Details

To help the caller avoid making comparisons that are not meaningful, the "dofv" value is reported as NA if any of the following is true:

  • the final estimation methods (as reported in the final "#METH:" line of the .lst file) of the model and reference model are not identical .

  • the final estimation method is one for which the objective function value is not meaningful for model comparison (e.g., SAEM or Bayesian methods).

  • the input data sets of the two models differs, as indicated by a different file path or different number of observations recorded in the .lst files.

    The above criteria serve to flag the common cases where the models use different input data. Note, however, that models may have used different data despite having a matching data path and number of observations.

See also