cleanup_model: cleanup_model

View source: R/functions_wrapper.R

cleanup_modelR Documentation

cleanup_model

Description

Perform various cleanups of a model

This is what is currently done

  • Make model statements declarative, i.e. only one assignment per symbol

  • Inline all assignments of one symbol, e.g. X = Y

  • Remove all random variables with no variability (i.e. with omegas fixed to zero)

  • Put fixed thetas directly in the model statements

Usage

cleanup_model(model)

Arguments

model

(Model) Pharmpy model object

Value

(Model) Updated model

Note

When creating NONMEM code from the cleaned model Pharmpy might need toadd certain assignments to make it in line with what NONMEM requires.

Examples

## Not run: 
model <- load_example_model("pheno")
model$statements
model <- cleanup_model(model)
model$statements

## End(Not run)

pharmpy/pharmr documentation built on Feb. 15, 2025, 3:22 a.m.