enetgt.grid | R Documentation |
Computes the elastic net estimators with weighted l1 norm on group testing data over a grid of lambda and theta values.
enetgt.grid( X, Y, Z, Se, Sp, n.lambda = 5, n.theta = 3, weights = 1, tol = 1e-04, E.approx = FALSE, verbose = FALSE, get.SEs = FALSE, ridge.include = 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. |
n.lambda |
Number of lambda values for which to compute the estimator. |
n.theta |
Number of theta values for which to compute the estimator. |
weights |
Vector of weights to be used in weighting the l1 penalty. Default is |
tol |
Convergence criterion. |
E.approx |
Logical. If |
verbose |
Logical. If |
get.SEs |
Logical. If |
ridge.include |
Logical. If |
A list of output which includes an array B.ENET
of solutions over the grid of lambda and theta values.
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
over a grid of lambda and theta values. Only the size of
the grid must be given, and the function chooses its own set of lambda and theta values.
# generate individual covariate values and disease statuses N <- 2000 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 n.lambda <- 10 n.theta <- 2 # compute the elastic net estimator with weights = 1 over grid of lambda and theta values enetgt.grid.out <- enetgt.grid(X, Y, Z, Se, Sp, n.lambda, n.theta, weights = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.