grouplasso_gt: Compute group lasso for two populations with group testing...

View source: R/grouplasso.R

grouplasso_gtR Documentation

Compute group lasso for two populations with group testing data

Description

Compute group lasso for two populations with group testing data

Usage

grouplasso_gt(
  Y,
  Z,
  Se,
  Sp,
  E.approx,
  X,
  groups,
  lambda,
  w,
  tol = 0.001,
  maxiter = 1000,
  init = NULL,
  report.prog = FALSE
)

Arguments

Y

Group testing output in the format as output by one of the functions individual.assay.gen, masterpool.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, masterpool.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.

E.approx

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

X

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

groups

a vector indicating to which group each covariate belongs

lambda

the level of sparsity penalization

w

group-specific weights for different penalization of different groups

tol

a convergence criterion

maxiter

the maximum allowed number of iterations (EM steps)

init

a list of initial values for the coefficient

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 semiparametric additive model with group testing data

Examples

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

grouplasso_gt.out <- grouplasso_gt(Y = grouplasso_gt_data$Y$I,
                                   Z = grouplasso_gt_data$Y$A,
                                   Se = grouplasso_gt_data$Y$Se,
                                   Sp = grouplasso_gt_data$Y$Sp,
                                   E.approx = grouplasso_gt_data$Y$E.approx,
                                   X = grouplasso_gt_data$X,
                                   groups = grouplasso_gt_data$groups,
                                   lambda = 1,
                                   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.