grouplasso_linreg_cv_adapt: Choose tuning parameters by crossvalidation for grouplasso...

View source: R/grouplasso.R

grouplasso_linreg_cv_adaptR Documentation

Choose tuning parameters by crossvalidation for grouplasso linreg with adaptive weights

Description

Choose tuning parameters by crossvalidation for grouplasso linreg with adaptive weights

Usage

grouplasso_linreg_cv_adapt(
  Y,
  X,
  groups,
  n.lambda,
  lambda.min.ratio,
  lambda.max.ratio = 1,
  n.folds,
  w,
  tol = 0.001,
  maxiter = 500,
  report.prog = TRUE
)

Arguments

Y

the response vector

X

matrix containing the design matrices

groups

a vector indicating to which group each covariate belongs

n.lambda

the number of lambda values desired

lambda.min.ratio

ratio of the smallest lambda value to the smallest value of lambda which admits no variables to the model

lambda.max.ratio

ratio of the largest lambda value to the smallest value of lambda which admits no variables to the model

n.folds

the number of crossvalidation folds

w

group-specific weights for different penalization toward similarity for different groups

tol

a convergence criterion

maxiter

the maximum allowed number of iterations

report.prog

a logical indicating whether the progress of the algorithm should be printed to the console

Value

a list containing the fits over a grid of lambda values as well as the vector of lambda values

Examples

grouplasso_linreg_data <- get_grouplasso_data(n = 400, response = "continuous")

grouplasso_linreg_cv_adapt.out <- grouplasso_linreg_cv_adapt(Y = grouplasso_linreg_data$Y,
                                                             X = grouplasso_linreg_data$X,
                                                             groups = grouplasso_linreg_data$groups,
                                                             n.lambda = 25,
                                                             lambda.min.ratio = 0.001,
                                                             lambda.max.ratio = 0.1,
                                                             n.folds = 5,
                                                             w = grouplasso_linreg_data$w,
                                                             tol = 1e-3,
                                                             maxiter = 500,
                                                             report.prog = FALSE)

gregorkb/semipadd2pop documentation built on Oct. 2, 2022, 1:37 p.m.