opt.penalty: Cross-validation of LASSO alpha and lambda
Description
Cross-validation of LASSO alpha and lambda.
Usage
opt.penalty(x, y, family, nfolds, lambda.opt, alpha, penalty.factor, n.samp2, mc.cores, ...)
Arguments
x
Design matrix, of dimension n x p.
y
Vector of quantitative response variable.
family
Distribution family of y.
nfolds
Number of folds (default is 10). See
lambda.opt
Criterion for optimum selection of cross-validated lasso.
Either "lambda.1se" (default) or "lambda.min". See
cv.glmnet for more details.
alpha
A single value or a vector of values in the range of 0 to 1 for
the elastic net mixing parameter. If more than one value are given, the best
is selected during cross-validation.
penalty.factor
See glmnet.
n.samp2
Number of individuals in samp2 which is the max.
for non zero coefficients.
mc.cores
Number of cores for parallelising. Theoretical maximum is
'B'. For details see mclapply.