set_time_varying_error_model#

pharmpy.modeling.set_time_varying_error_model(model, cutoff, idv='TIME', dv=None)[source]#

Set a time varying error model per time cutoff

Parameters:
  • model (Model) – Pharmpy model

  • cutoff (float) – A cutoff value for idv column

  • idv (str) – Time or time after dose, default is Time

  • dv (Union[Expr, str, int, None]) – Name or DVID of dependent variable. None for the default (first or only)

Returns:

Model – Pharmpy model object

Examples

>>> from pharmpy.modeling import load_example_model, set_time_varying_error_model
>>> model = load_example_model("pheno")
>>> model = set_time_varying_error_model(model, cutoff=1.0)
>>> model.statements.find_assignment("Y")
    ⎧EPS₁⋅F⋅time_varying + F  for TIME < 1.0

Y = ⎩      EPS₁⋅F + F           otherwise