run_covsearch#
- pharmpy.tools.run_covsearch(search_space, p_forward=0.01, p_backward=0.001, max_steps=-1, algorithm='scm-forward-then-backward', results=None, model=None, strictness='minimization_successful or (rounding_errors and sigdigs>=0.1)', naming_index_offset=0, **kwargs)#
Run COVsearch tool. For more details, see COVsearch.
- Parameters:
search_space (str) – MFL of covariate effects to try
p_forward (float) – The p-value to use in the likelihood ratio test for forward steps
p_backward (float) – The p-value to use in the likelihood ratio test for backward steps
max_steps (int) – The maximum number of search steps to make
algorithm ({‘scm-forward’, ‘scm-forward-then-backward’}) – The search algorithm to use. Currently, ‘scm-forward’ and ‘scm-forward-then-backward’ are supported.
results (ModelfitResults) – Results of model
model (Model) – Pharmpy model
strictness (str or None) – Strictness criteria
naming_index_offset (int) – index offset for naming of runs. Default is 0
kwargs – Arguments to pass to tool
- Returns:
COVSearchResults – COVsearch tool result object
Examples
>>> from pharmpy.modeling import load_example_model >>> from pharmpy.tools import run_covsearch, load_example_modelfit_results >>> model = load_example_model("pheno") >>> results = load_example_modelfit_results("pheno") >>> search_space = 'COVARIATE([CL, V], [AGE, WT], EXP)' >>> res = run_covsearch(search_space, model=model, results=results)