Run COVsearch tool. For more details, see :ref:covsearch.
run_covsearch(
model,
results,
search_space,
p_forward = 0.01,
p_backward = 0.001,
max_steps = -1,
algorithm = "scm-forward-then-backward",
max_eval = FALSE,
adaptive_scope_reduction = FALSE,
strictness = "minimization_successful or (rounding_errors and sigdigs>=0.1)",
parameter_uncertainty_method = NULL,
naming_index_offset = 0,
nsamples = 10,
.samba_max_covariates = 3,
.samba_selection_criterion = "bic",
.samba_linreg_method = "ols",
.samba_stepwise_lcs = NULL,
...
)(COVSearchResults) COVsearch tool result object
(Model) Pharmpy model
(ModelfitResults) Results of model
(str or ModelFeatures) MFL of covariate effects to try
(numeric) The p-value to use in the likelihood ratio test for forward steps
(numeric) The p-value to use in the likelihood ratio test for backward steps
(numeric) The maximum number of search steps to make
(str) The search algorithm to use. Currently, 'scm-forward' and 'scm-forward-then-backward' are supported.
(logical) Limit the number of function evaluations to 3.1 times that of the base model. Default is FALSE.
(logical) Stash all non-significant parameter-covariate effects to be tested after all significant effects have been tested. Once all these have been tested, try adding the stashed effects once more with a regular forward approach. Default is FALSE
(str) Strictness criteria
(str (optional)) Parameter uncertainty method. Will be used in ranking models if strictness includes parameter uncertainty
(numeric (optional)) index offset for naming of runs. Default is 0.
(numeric) Number of samples from individual parameter conditional distribution for linear covariate model selection. Default is 10, i.e. generating 10 samples per subject
(numeric (optional)) Maximum number of covariate inclusion allowed in linear covariate screening for each parameter.
(str) Method used to fit linear covariate models. Currently, Ordinary Least Squares (ols), Weighted Least Squares (wls), and Linear Mixed-Effects (lme) are supported.
(str) Method used for linear and nonlinear model selection in SAMBA methods. Currently, BIC and LRT are supported.
(logical (optional)) Use stepwise linear covariate screening or not. By default, SAMBA methods use stepwise LCS whereas SCM-LCS uses non-stepwise LCS
Arguments to pass to tool
if (FALSE) {
model <- load_example_model("pheno")
results <- load_example_modelfit_results("pheno")
search_space <- 'COVARIATE(c(CL, V), c(AGE, WT), EXP)'
res <- run_covsearch(model=model, results=results, search_space=search_space)
}
Run the code above in your browser using DataLab