grouplasso_gt_cv_adapt: Choose tuning parameters for the group lasso estimator with...

View source: R/grouplasso.R

grouplasso_gt_cv_adaptR Documentation

Choose tuning parameters for the group lasso estimator with group testing data

Description

Choose tuning parameters for the group lasso estimator with group testing data

Usage

grouplasso_gt_cv_adapt(
  Y,
  Z,
  Se,
  Sp,
  X,
  E.approx = FALSE,
  groups,
  n.lambda,
  n.eta,
  lambda.min.ratio,
  lambda.max.ratio,
  n.folds,
  w,
  tol = 0.001,
  maxiter = 1000,
  report.prog = TRUE
)

Arguments

Y

Group testing output in the format as output by one of the functions individual.assay.gen, dorfman.assay.gen, or array.assay.gen.

Z

Group testing output in the format as output by one of the functions individual.assay.gen, dorfman.assay.gen, or array.assay.gen.

Se

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.

Sp

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.

X

matrix containing the design matrices

E.approx

a logical indicating whether the conditional expectations in the E-step should be computed approximately or exactly.

groups

a vector indicating to which group each covariate belongs

n.lambda

the number of lambda values

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 (EM steps)

report.prog

a logical. If TRUE then the number of inner loops required to complete the M step of the EM algorithm are returned after each EM step.

Value

Returns the estimator of the parametric model with group testing data

Examples

grouplasso_gt_data <- get_grouplasso_data(n = 1000, response = "gt")

grouplasso_gt_cv.out <- grouplasso_gt_cv_adapt(Y = grouplasso_gt_data$Y$I,
                                               Z = grouplasso_gt_data$Y$A,
                                               Se = grouplasso_gt_data$Y$Se,
                                               Sp = grouplasso_gt_data$Y$Sp,
                                               X = grouplasso_gt_data$X,
                                               E.approx = grouplasso_gt_data$Y$E.approx,
                                               groups = grouplasso_gt_data$groups,
                                               n.lambda = 10,
                                               lambda.min.ratio = 0.01,
                                               lambda.max.ratio = 0.50,
                                               n.folds = 5,
                                               w  = grouplasso_gt_data$w,
                                               tol = 1e-3,
                                               maxiter = 500,
                                               report.prog = TRUE)

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