aic.bic.eric.enetgt.grid: Chooses tuning parameters via AIC, BIC, and ERIC.

View source: R/aenetgt.R

aic.bic.eric.enetgt.gridR Documentation

Chooses tuning parameters via AIC, BIC, and ERIC.

Description

Chooses tuning parameters via AIC, BIC, and ERIC.

Usage

aic.bic.eric.enetgt.grid(enetgt.grid.out, Z, X, Se, Sp, regime)

Arguments

enetgt.grid.out

List object returned by the function enetgt.grid.

Z

Group testing output from one of the functions individual.assay.gen, masterpool.assay.gen, dorfman.assay.gen, or array.assay.gen.

X

Design matrix with first column a column of 1s.

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.

regime

Testing regime which must be equal to one of individual, masterpool, dorfman, array, and dorfman.individual.

Value

A list object including the tuning parameter combinations selected by AIC, BIC, and ERIC.

Computes the AIC, BIC and ERIC criteria over a grid of lambda, theta pairs coming from enetgt.grid.out, which is an object returned by enetgt.grid().

Examples

data <- model0(200)
X <- data$X
Y.true <- data$Y
# subject individuals to individual testing
Se <- c(.94) # individual testing sensitivities
Sp <- c(.95) # individual testing specificities
assay.data <- individual.assay.gen(Y.true,Se,Sp,cj=1)
Z <- assay.data$Z
Y <- assay.data$Y
# compute the mle on the individual testing data:
mlegt.out <- mlegt(X,Y,Z,Se,Sp,tol=.01)
b.mle <- mlegt.out$b.mle
# compute adaptive elastic net estimator over a grid of tuning parameter values
n.lambda <- 8
n.theta <- 2
enetgt.grid.out <- enetgt.grid(X,Y,Z,Se,Sp,n.lambda,n.theta,weights = 1/abs(b.mle[-1]),tol=.01)
# make choices of the tuning parameters according to the aic, bic, and eric criteria
aic.bic.eric.enetgt.grid.out <- aic.bic.eric.enetgt.grid(enetgt.grid.out,Z,X,Se,Sp,"individual")
b.aenet.aic <- aic.bic.eric.enetgt.grid.out$b.enet.aic
b.aenet.bic <- aic.bic.eric.enetgt.grid.out$b.enet.bic
b.aenet.eric <- aic.bic.eric.enetgt.grid.out$b.enet.eric
b.aenet.aic 
b.aenet.bic
b.aenet.eric

gregorkb/aenetgt documentation built on Oct. 12, 2022, 11:51 a.m.