cv.dsda {TULIP} | R Documentation |
Cross validation for direct sparse discriminant analysis
Description
Choose the optimal lambda for direct sparse discriminant analysis by cross validation.
Usage
cv.dsda(x, y, nfolds = 5, lambda=lambda, lambda.opt="min",
standardize=FALSE, alpha=1, eps=1e-7)
Arguments
x |
An n by p matrix containing the predictors. |
y |
An n-dimensional vector containing the class labels. |
nfolds |
The number of folds to be used in cross validation. Default is 5. |
lambda |
A sequence of lambda's. |
lambda.opt |
Should be either "min" or "max", specifying whether the smallest or the largest lambda with the smallest cross validation error should be used for the final classification rule. |
standardize |
A logic object indicating whether x.matrix should be standardized before performing DSDA. Default is FALSE. |
alpha |
The elasticnet mixing parameter, the same as in glmnet. Default is alpha=1 so that the lasso penalty is used. |
eps |
Convergence threshold for coordinate descent, the same as in glmnet. Default is 1e-7. |
Value
lambda |
The sequence of lambda's used in cross validation. |
cvm |
Cross validation errors. |
cvsd |
The standard error of the cross validation errors. |
lambda.min |
The optimal lambda chosen by cross validation. |
model.fit |
The fitted model. |
References
Mai, Q., Zou, H. and Yuan, M. (2013). A direct approach to sparse discriminant analysis in ultra-high dimensions. Biometrika, 99, 29-42.
See Also
cv.dsda
predict.dsda
dsda