run_modelsearch#

pharmpy.tools.run_modelsearch(search_space, algorithm, iiv_strategy='absorption_delay', rank_type='bic', cutoff=None, results=None, model=None, strictness='minimization_successful or (rounding_errors and sigdigs >= 0.1)', E=None, **kwargs)#

Run Modelsearch tool. For more details, see Modelsearch.

Parameters:
  • search_space (str, ModelFeatures) – Search space to test. Either as a string or a ModelFeatures object.

  • algorithm ({‘exhaustive’, ‘exhaustive_stepwise’, ‘reduced_stepwise’}) – Algorithm to use.

  • iiv_strategy ({‘no_add’, ‘add_diagonal’, ‘fullblock’, ‘absorption_delay’}) – If/how IIV should be added to candidate models. Default is ‘absorption_delay’.

  • rank_type ({‘ofv’, ‘lrt’, ‘aic’, ‘bic’, ‘mbic’}) – Which ranking type should be used. Default is BIC.

  • cutoff (float) – Cutoff for which value of the ranking function that is considered significant. Default is None (all models will be ranked)

  • results (ModelfitResults) – Results for model

  • model (Model) – Pharmpy model

  • strictness (str or None) – Strictness criteria

  • E (float) – Expected number of predictors (used for mBIC). Must be set when using mBI

  • kwargs – Arguments to pass to tool

Returns:

ModelSearchResults – Modelsearch tool result object

Examples

>>> from pharmpy.modeling import load_example_model
>>> from pharmpy.tools import run_modelsearch, load_example_modelfit_results
>>> model = load_example_model("pheno")
>>> results = load_example_modelfit_results("pheno")
>>> run_modelsearch('ABSORPTION(ZO);PERIPHERALS(1)', 'exhaustive', results=results, model=model)