grouplasso2pop_gt_cv_fixedgrid: Choose tuning parameters by crossvalidation for...

View source: R/grouplasso2pop.R

grouplasso2pop_gt_cv_fixedgridR Documentation

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

Description

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

Usage

grouplasso2pop_gt_cv_fixedgrid(
  Y1,
  Z1,
  Se1,
  Sp1,
  X1,
  groups1,
  E.approx1 = FALSE,
  Y2,
  Z2,
  Se2,
  Sp2,
  X2,
  groups2,
  E.approx2 = FALSE,
  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 = TRUE
)

Arguments

Y1

Group testing output for data set 1 in the format as output by one of the functions individual.assay.gen, masterpool.assay.gen, dorfman.assay.gen, or array.assay.gen.

Z1

Group testing output for data set 1 in the format as output by one of the functions individual.assay.gen, masterpool.assay.gen, dorfman.assay.gen, or array.assay.gen.

Se1

A vector of testing sensitivities, where the first element is the testing specificity for pools and the second entry is the test specificity for individual testing, if applicable.

Sp1

A vector of testing specificities, where the first element is the testing specificity for pools and the second entry is the test specificity for individual testing, if applicable.

X1

the matrix with the observed covariate values for data set 1 (including a column of ones for the intercept)

groups1

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

E.approx1

a logical indicating whether the conditional expectations in the E-step should be computed approximately or exactly for data set 1

Y2

Group testing output for data set 2 in the format as output by one of the functions individual.assay.gen, masterpool.assay.gen, dorfman.assay.gen, or array.assay.gen.

Z2

Group testing output for data set 2 in the format as output by one of the functions individual.assay.gen, masterpool.assay.gen, dorfman.assay.gen, or array.assay.gen.

Se2

A vector of testing sensitivities, where the first element is the testing specificity for pools and the second entry is the test specificity for individual testing, if applicable.

Sp2

A vector of testing specificities, where the first element is the testing specificity for pools and the second entry is the test specificity for individual testing, if applicable.

X2

the matrix with the observed covariate values for data set 2 (including a column of ones for the intercept)

groups2

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

E.approx2

a logical indicating whether the conditional expectations in the E-step should be computed approximately or exactly for data set 2

rho1

weight placed on the first data set

rho2

weight placed on the second data set

lambda.seq

the sequence of lambda values

eta.seq

the 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

a convergence criterion

maxiter

the maximum allowed number of iterations (EM steps)

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_gt_data <- get_grouplasso2pop_data( n1 = 1000, n2 = 1200, response = "gt")

grouplasso2pop_gt_grid.out <- grouplasso2pop_gt_grid(Y1 = grouplasso2pop_gt_data$Y1$I,
                                                     Z1 = grouplasso2pop_gt_data$Y1$A,
                                                     Se1 = grouplasso2pop_gt_data$Y1$Se,
                                                     Sp1 = grouplasso2pop_gt_data$Y1$Sp,
                                                     X1 = grouplasso2pop_gt_data$X1,
                                                     groups1 = grouplasso2pop_gt_data$groups1,
                                                     E.approx1 = grouplasso2pop_gt_data$Y1$E.approx,
                                                     Y2 = grouplasso2pop_gt_data$Y2$I,
                                                     Z2 = grouplasso2pop_gt_data$Y2$A,
                                                     Se2 = grouplasso2pop_gt_data$Y2$Se,
                                                     Sp2 = grouplasso2pop_gt_data$Y2$Sp,
                                                     X2 = grouplasso2pop_gt_data$X2,
                                                     groups2  = grouplasso2pop_gt_data$groups2,
                                                     E.approx2 = grouplasso2pop_gt_data$Y2$E.approx,
                                                     rho1 = 1,
                                                     rho2 = 1,
                                                     n.lambda = 10,
                                                     n.eta = 5,
                                                     lambda.min.ratio = 0.01,
                                                     lambda.max.ratio = 0.50,
                                                     eta.min.ratio = 0.01,
                                                     eta.max.ratio = 1,
                                                     w1 = grouplasso2pop_gt_data$w1,
                                                     w2 = grouplasso2pop_gt_data$w2,
                                                     w = grouplasso2pop_gt_data$w,
                                                     AA1 = grouplasso2pop_gt_data$AA1,
                                                     AA2 = grouplasso2pop_gt_data$AA2,
                                                     Com = grouplasso2pop_gt_data$Com,
                                                     tol = 1e-3,
                                                     maxiter = 500,
                                                     report.prog = TRUE)

grouplasso2pop_gt_cv_fixedgrid.out <- grouplasso2pop_gt_cv_fixedgrid(Y1 = grouplasso2pop_gt_data$Y1$I,
                                                                     Z1 = grouplasso2pop_gt_data$Y1$A,
                                                                     Se1 = grouplasso2pop_gt_data$Y1$Se,
                                                                     Sp1 = grouplasso2pop_gt_data$Y1$Sp,
                                                                     X1 = grouplasso2pop_gt_data$X1,
                                                                     groups1 = grouplasso2pop_gt_data$groups1,
                                                                     E.approx1 = grouplasso2pop_gt_data$Y1$E.approx,
                                                                     Y2 = grouplasso2pop_gt_data$Y2$I,
                                                                     Z2 = grouplasso2pop_gt_data$Y2$A,
                                                                     Se2 = grouplasso2pop_gt_data$Y2$Se,
                                                                     Sp2 = grouplasso2pop_gt_data$Y2$Sp,
                                                                     X2 = grouplasso2pop_gt_data$X2,
                                                                     groups2  = grouplasso2pop_gt_data$groups2,
                                                                     E.approx2 = grouplasso2pop_gt_data$Y2$E.approx,
                                                                     rho1 = 1,
                                                                     rho2 = 1,
                                                                     lambda.seq = grouplasso2pop_gt_grid.out$lambda.seq,
                                                                     eta.seq = grouplasso2pop_gt_grid.out$eta.seq,
                                                                     n.folds = 5,
                                                                     b1.init.arr = grouplasso2pop_gt_grid.out$b1.arr,
                                                                     b2.init.arr = grouplasso2pop_gt_grid.out$b2.arr,
                                                                     w1 = grouplasso2pop_gt_data$w1,
                                                                     w2 = grouplasso2pop_gt_data$w2,
                                                                     w = grouplasso2pop_gt_data$w,
                                                                     AA1 = grouplasso2pop_gt_data$AA1,
                                                                     AA2 = grouplasso2pop_gt_data$AA2,
                                                                     Com = grouplasso2pop_gt_data$Com,
                                                                     tol = 1e-2,
                                                                     maxiter = 500)

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