Learn R Programming

pharmr (version 1.4.0)

run_covsearch: run_covsearch

Description

Run COVsearch tool. For more details, see :ref:covsearch.

Usage

run_covsearch(
  search_space,
  p_forward = 0.01,
  p_backward = 0.001,
  max_steps = -1,
  algorithm = "scm-forward-then-backward",
  results = NULL,
  model = NULL,
  max_eval = FALSE,
  adaptive_scope_reduction = FALSE,
  strictness = "minimization_successful or (rounding_errors and sigdigs>=0.1)",
  naming_index_offset = 0,
  nsamples = 10,
  .statsmodels = FALSE,
  .weighted_linreg = FALSE,
  .lin_filter = 0,
  ...
)

Value

(COVSearchResults) COVsearch tool result object

Arguments

search_space

(str or ModelFeatures) MFL of covariate effects to try

p_forward

(numeric) The p-value to use in the likelihood ratio test for forward steps

p_backward

(numeric) The p-value to use in the likelihood ratio test for backward steps

max_steps

(numeric) The maximum number of search steps to make

algorithm

(str) The search algorithm to use. Currently, 'scm-forward' and 'scm-forward-then-backward' are supported.

results

(ModelfitResults (optional)) Results of model

model

(Model (optional)) Pharmpy model

max_eval

(logical) Limit the number of function evaluations to 3.1 times that of the base model. Default is FALSE.

adaptive_scope_reduction

(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

strictness

(str (optional)) Strictness criteria

naming_index_offset

(numeric (optional)) index offset for naming of runs. Default is 0.

nsamples

(numeric) Number of samples from individual parameter conditional distribution for linear covariate model selection. nsamples=0 uses ETAs to for linear model selection, whereas nsample>=1 generates MCMC samples with an additional SAEM estimation step. When multiple samples are generated, linear mixed effects model will be used to fit the linear models. Default is 10, i.e. generating 10 samples per subject

.statsmodels

(logical) Estimation tool for SAMBA linear covariate model fitting. 'TRUE' calls statsmodel's functionalities, whereas 'FALSE' calls nonmem.

.weighted_linreg

(logical) When using nonmem to run linear covariate models, 'TRUE' uses ETC as weight to run WLS.

.lin_filter

(numeric) Option to control the number of covariates passed to nonlinear selection

...

Arguments to pass to tool

Examples

Run this code
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(search_space, model=model, results=results)
}

Run the code above in your browser using DataLab