set_n_transit_compartments#

pharmpy.modeling.set_n_transit_compartments(model, keep_depot=True)[source]#

Set the n-transit compartments model

This is the absorption delay model where the number of transit compartments is a parameter to be estimated. Initial estimate for absorption rate is set the previous rate if available, otherwise it is set to the time of first observation/2. Initial estimate for the number of transit compartments is set to 2.

Currently only handles a single oral route of administration. Assumes complete absorption between doses

Parameters:
  • model (Model) – Pharmpy model

  • keep_depot (bool) – False to convert depot compartment into a transit compartment

Returns:

Model – Updated Pharmpy model

Examples

>>> from pharmpy.modeling import *
>>> model = load_example_model("pheno")
>>> model = set_n_transit_compartments(model)