Learn R Programming

pharmr (version 2.2.0)

calculate_bic: calculate_bic

Description

Calculate BIC

Different variations of the BIC can be calculated:

  • | mixed :footcite:p:delattre_2014 (default) | BIC = -2LL + n_random_parameters * log(n_individuals) + | n_fixed_parameters * log(n_observations)

  • | fixed :footcite:p:delattre_2020 | BIC = -2LL + n_estimated_parameters * log(n_observations)

  • | random | BIC = -2LL + n_estimated_parameters * log(n_individuals)

  • | iiv | BIC = -2LL + n_estimated_iiv_omega_parameters * log(n_individuals)

note::

Note that for the mixed BIC sigmas are always counted as fixed parameters and thetas can be counted as random if it associated with an eta. See :footcite:p:delattre_2014 for details.

footbibliography::

Usage

calculate_bic(model, likelihood, type = "mixed")

Value

(numeric) BIC of model fit

Arguments

model

(Model) Pharmpy model

likelihood

(numeric) -2LL to use

type

(str) Type of BIC to calculate. Default is the mixed effects.

Examples

Run this code
if (FALSE) {
model <- load_example_model("pheno")
results <- load_example_modelfit_results("pheno")
ofv <- results$ofv
calculate_bic(model, ofv)
calculate_bic(model, ofv, type='fixed')
calculate_bic(model, ofv, type='random')
calculate_bic(model, ofv, type='iiv')
}

Run the code above in your browser using DataLab