glmsmurf.control: Control Function for Fitting a Multi-Type Regularized GLM...

View source: R/glmsmurf_control.R

glmsmurf.controlR Documentation

Control Function for Fitting a Multi-Type Regularized GLM Using the SMuRF Algorithm.

Description

Control function to handle parameters for fitting a multi-type regularized generalized linear model (GLM) using the SMuRF algorithm. The function sets defaults and performs input checks on the provided parameters.

Usage

glmsmurf.control(
  epsilon = 1e-08,
  maxiter = 10000,
  step = NULL,
  tau = 0.5,
  reest = TRUE,
  lambda.vector = NULL,
  lambda.min = NULL,
  lambda.max = NULL,
  lambda.length = 50L,
  lambda.reest = FALSE,
  k = 5L,
  oos.prop = 0.2,
  validation.index = NULL,
  ncores = NULL,
  po.ncores = NULL,
  print = FALSE
)

Arguments

epsilon

Numeric tolerance value for stopping criterion. A numeric strictly larger than 0, default is 1e-8.

maxiter

Maximum number of iterations of the SMuRF algorithm. A numeric larger than or equal to 1, default is 10 000.

step

Initial step size, a numeric strictly larger than 0 or NULL. When NULL (default), it is equal to 0.1 times the sample size.

tau

Parameter for backtracking the step size. A numeric strictly between 0 and 1, default is 0.5.

reest

A logical indicating if the obtained (reduced) model is re-estimated using glm. Default is TRUE.

lambda.vector

Values of lambda to consider when selecting the optimal value of lambda. A vector of strictly positive numerics (which is preferably a decreasing sequence as we make use of warm starts) or NULL (default). When NULL, it is set to an exponential decreasing sequence of length lambda.length between lambda.max and lambda.min.

lambda.min

Minimum value of lambda to consider when selecting the optimal value of lambda. A strictly positive numeric or NULL (default). When NULL, it is equal to 0.0001 times lambda.max. This argument is ignored when lambda.vector is not NULL.

lambda.max

Maximum value of lambda to consider when selecting the optimal value of lambda. A strictly positive numeric larger than lambda.min or NULL (default). In the latter case, lambda.max will be determined based on the used penalty types such that it is one of the smallest values of lambda that results in an intercept-only model. This argument is ignored when lambda.vector is not NULL.

lambda.length

Number of lambda values to consider when selecting the optimal value of lambda. A strictly positive integer, default is 50. This argument is ignored when lambda.vector is not NULL.

lambda.reest

Logical indicating if the re-estimated coefficients are used when selecting lambda, default is FALSE. This argument is only used if reest is TRUE.

k

Number of folds when selecting lambda using cross-validation. A strictly positive integer, default is 5 (i.e. five-fold cross-validation). This number cannot be larger than the number of observations. Note that cross-validation with one fold (k=1) is the same as in-sample selection of lambda.

oos.prop

Proportion of the data that is used as the validation sample when selecting lambda out-of-sample. A numeric strictly between 0 and 1, default is 0.2. This argument is ignored when validation.index is not NULL.

validation.index

Vector containing the row indices of the data matrix corresponding to the observations that are used as the validation sample. This argument is only used when lambda is selected out-of-sample. Default is NULL meaning that randomly 100*oos.prop% of the data are used as validation sample.

ncores

Number of cores used when performing cross-validation. A strictly positive integer or NULL (default). When NULL, max(nc-1,1) cores are used where nc is the number of cores as determined by detectCores.

po.ncores

Number of cores used when computing the proximal operators. A strictly positive integer or NULL (default). When NULL or ncores > 1, po.ncores is set to 1.

print

A logical indicating if intermediate results need to be printed, default is FALSE.

Details

More details on the selection of lambda can be found in the package vignette.

Value

A list with elements named as the arguments.

See Also

Fitting procedures: glmsmurf and glmsmurf.fit (given design matrix). glm.control

Examples

## See example(plot_lambda) for examples 

smurf documentation built on March 31, 2023, 7:52 p.m.