add_residuals#

pharmpy.modeling.add_residuals(model, res)[source]#

Add predictions and/or residuals

Add residuals to estimation step.

Parameters:
  • model (Model) – Pharmpy model

  • res (list) – List of residuals (e.g. [‘CWRES’])

Returns:

Model – Pharmpy model object

Examples

>>> from pharmpy.modeling import *
>>> model = load_example_model("pheno")
>>> model.estimation_steps[-1].residuals
('CWRES',)
>>> model = add_residuals(model, ['RES'])
>>> model.estimation_steps[-1].residuals
('CWRES', 'RES')