add_estimation_step#

pharmpy.modeling.add_estimation_step(model, method, idx=None, **kwargs)[source]#

Add estimation step

Adds estimation step for a model in a given index. Methods currently supported are:

FO, FOCE, ITS, LAPLACE, IMPMAP, IMP, SAEM

Parameters:
  • model (Model) – Pharmpy model

  • method ({‘FO’, ‘FOCE’, ‘ITS’, ‘LAPLACE’, ‘IMPMAP’, ‘IMP’, ‘SAEM’, ‘BAYES’}) – estimation method to change to

  • idx (int) – index of estimation step (starting from 0), default is None (adds step at the end)

  • kwargs – Arguments to pass to EstimationStep (such as interaction, evaluation)

Returns:

Model – Pharmpy model object

Examples

>>> from pharmpy.modeling import *
>>> model = load_example_model("pheno")
>>> opts = {'NITER': 1000, 'ISAMPLE': 100}
>>> model = add_estimation_step(model, 'IMP', tool_options=opts)
>>> ests = model.estimation_steps
>>> len(ests)
2
>>> ests[1]   
EstimationStep('IMP', interaction=False, parameter_uncertainty_method=None, ..., tool_options={'NITER': 1000,...