get_nested_model: get_nested_model

View source: R/functions_wrapper.R

get_nested_modelR Documentation

get_nested_model

Description

Return nested model from a pair of models

Function to get a nested model from a pair of models, NULL if neither model is nested. A model is not considered nested if:

  1. They are the same model

  2. They have the same number of parameters

  3. The parameters of the reduced model is not a subset of the extended model

  4. The dosing or DV is changed

Assumptions made:

  1. Parametrization is the same

  2. Parameter names are the same

Usage

get_nested_model(model_1, model_2)

Arguments

model_1

(Model) Pharmpy model object

model_2

(Model) Pharmpy model object

Value

(Model | NULL) Pharmpy model object or NULL

Examples

## Not run: 
model_1 <- load_example_model("pheno")
model_2 <- add_peripheral_compartment(model_1)
model_2 <- set_name(model_2, 'pheno_2')
nested <- get_nested_model(model_1, model_2)
nested$name

## End(Not run)


pharmpy/pharmr documentation built on June 11, 2025, 11:56 a.m.