enetgt | R Documentation |
Computes the elastic net estimator with weighted l1 norm on group testing data.
enetgt( X, Y, Z, Se, Sp, lambda, theta, weights = 1, binit = NULL, tol = 1e-04, E.approx = FALSE, get.SEs = FALSE )
X |
Design matrix with first column a column of 1s. |
Y |
Group testing output from one of the functions |
Z |
Group testing output from one of the functions |
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. |
lambda |
Tuning parameter. |
theta |
Ridge versus lasso penalty mixer. |
weights |
Vector of weights to be used in weighting the l1 penalty. Default is |
binit |
Initial values for EM-algorithm. |
tol |
Convergence criterion. |
E.approx |
Logical. If |
get.SEs |
Logical. If |
The elastic net estimator with weighted l1 norm under the choices of lambda
, theta
, and weights
.
This function implements a penalized EM-algorithm to find the elastic net estimator with weighted l1 norm based on the observed data X
, Y
, Z
, and the sensitivities and specificities in Se
, Sp
.
# generate individual covariate values and disease statuses N <- 5000 data <- model1(N) X <- data$X Y.true <- data$Yi Se <- c(.95) # set individual assay sensitivity Sp <- c(.97) # set individual assay specificity cj <- 1 # set size of master pools # subject individuals to individual testing assay.data <- individual.assay.gen(Y.true,Se,Sp,cj) Z <- assay.data$Z Y <- assay.data$Y # compute the elastic net estimator with weights = 1 enetgt.out <- enetgt(X, Y, Z, Se, Sp, lambda=10, theta=.5, weights = 1) # compute adaptive elastic net with weights from the elastic net estimator a.enetgt.out <- enetgt(X, Y, Z, Se, Sp, lambda=.5, theta=.5, weights = 1/abs(enetgt.out$b.enet[-1]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.