grouplasso2pop_logreg_cv_fixedgrid: Choose tuning parameters by crossvalidation for...

View source: R/grouplasso2pop.R

grouplasso2pop_logreg_cv_fixedgridR Documentation

Choose tuning parameters by crossvalidation for grouplasso2pop logreg when given a fixed grid of lambda and eta values

Description

Choose tuning parameters by crossvalidation for grouplasso2pop logreg when given a fixed grid of lambda and eta values

Usage

grouplasso2pop_logreg_cv_fixedgrid(
  Y1,
  X1,
  groups1,
  Y2,
  X2,
  groups2,
  rho1,
  rho2,
  lambda.seq,
  eta.seq,
  n.folds,
  b1.init.arr,
  b2.init.arr,
  w1,
  w2,
  w,
  AA1,
  AA2,
  Com,
  tol = 0.001,
  maxiter = 500,
  report.prog = FALSE
)

Arguments

Y1

the binary response vector of data set 1

X1

matrix containing the design matrices for data set 1

groups1

a vector indicating to which group each covariate of data set 1 belongs

Y2

the binary response vector of data set 2

X2

matrix containing the design matrices for data set 2

groups2

a vector indicating to which group each covariate of data set 2 belongs

rho1

weight placed on the first data set

rho2

weight placed on the second data set

lambda.seq

sequence of lambda values

eta.seq

sequence of eta values

n.folds

the number of crossvalidation folds

b1.init.arr

array of initial values for beta1

b2.init.arr

array of initial values for beta2

w1

group-specific weights for different penalization across groups in data set 1

w2

group-specific weights for different penalization across groups in data set 2

w

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

AA1

a list of the matrices A2j

Com

the indices of the covariate groups which are common in the two datasets

tol

the convergence tolerance

maxiter

the maximum number of iterations allowed for each fit

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 and eta values as well as the vector of lambda values and the vector of eta values

Examples

grouplasso2pop_logreg_data <- get_grouplasso2pop_data(n1 = 1000, n2 = 800, response = "binary")

grouplasso2pop_logreg_grid.out <- grouplasso2pop_logreg_grid(Y1 = grouplasso2pop_logreg_data$Y1,
                                                             X1 = grouplasso2pop_logreg_data$X1,
                                                             groups1 = grouplasso2pop_logreg_data$groups1,
                                                             Y2 = grouplasso2pop_logreg_data$Y2,
                                                             X2 = grouplasso2pop_logreg_data$X2,
                                                             groups2 = grouplasso2pop_logreg_data$groups2,
                                                             rho1 = 1,
                                                             rho2 = 1,
                                                             n.lambda = 5,
                                                             n.eta = 3,
                                                             lambda.min.ratio = 0.001,
                                                             lambda.max.ratio = 0.50,
                                                             w1 = grouplasso2pop_logreg_data$w1,
                                                             w2 = grouplasso2pop_logreg_data$w2,
                                                             w = grouplasso2pop_logreg_data$w,
                                                             AA1 = grouplasso2pop_logreg_data$AA1,
                                                             AA2 = grouplasso2pop_logreg_data$AA2,
                                                             Com = grouplasso2pop_logreg_data$Com,
                                                             tol = 1e-3,
                                                             maxiter = 500,
                                                             report.prog = TRUE)

grouplasso2pop_logreg_cv_fixedgrid.out <- grouplasso2pop_logreg_cv_fixedgrid(Y1 = grouplasso2pop_logreg_data$Y1,
                                                                             X1 = grouplasso2pop_logreg_data$X1,
                                                                             groups1 = grouplasso2pop_logreg_data$groups1,
                                                                             Y2 = grouplasso2pop_logreg_data$Y2,
                                                                             X2 = grouplasso2pop_logreg_data$X2,
                                                                             groups2 = grouplasso2pop_logreg_data$groups2,
                                                                             rho1 = 1,
                                                                             rho2 = 1,
                                                                             lambda.seq = grouplasso2pop_logreg_grid.out$lambda.seq,
                                                                             eta.seq = grouplasso2pop_logreg_grid.out$eta.seq,
                                                                             n.folds = 5,
                                                                             b1.init.arr = grouplasso2pop_logreg_grid.out$b1.arr,
                                                                             b2.init.arr = grouplasso2pop_logreg_grid.out$b2.arr,
                                                                             w1 = grouplasso2pop_logreg_data$w1,
                                                                             w2 = grouplasso2pop_logreg_data$w2,
                                                                             w = grouplasso2pop_logreg_data$w,
                                                                             AA1 = grouplasso2pop_logreg_data$AA1,
                                                                             AA2 = grouplasso2pop_logreg_data$AA2,
                                                                             Com = grouplasso2pop_logreg_data$Com,
                                                                             tol = 1e-3,
                                                                             maxiter = 500,
                                                                             report.prog = TRUE)

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