dsda {TULIP} | R Documentation |
Solution path for direct sparse discriminant analysis
Description
Compute the solution path for direct sparse discriminant analysis (DSDA).
Usage
dsda(x, z=NULL, y, testx=NULL, testz=NULL, standardize=FALSE,
lambda=lambda, alpha=1, eps=1e-7)
Arguments
x |
Input matrix of predictors. |
z |
Input covariate matrix of dimension |
y |
An n-dimensional vector containing the class labels. The classes have to be labeled as 1 and 2. |
testx |
Input testing matrix. Each row is a test case. When |
testz |
Input testing covariate matrix. Can be omitted if covariate is absent. However, training covariates |
standardize |
A logic object indicating whether x should be standardized before performing DSDA. Default is FALSE. |
lambda |
A sequence of lambda's. If lambda is missed, the function will automatically generates a sequence of lambda's to fit model. |
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
beta |
Output variable coefficients for each lambda. The first element of each solution is the intercept. |
lambda |
The sequence of lambda's used in computing the solution path. |
x |
The predictor matrix in training data. |
y |
The class label in training data. |
pred |
Predicted categorical response for each value in sequence |
Author(s)
Yuqing Pan, Qing Mai, Xin Zhang
References
Mai, Q., Zou, H. and Yuan, M. (2013). A direct approach to sparse discriminant analysis in ultra-high dimensions. Biometrika, 99, 29-42.
Examples
data(GDS1615) ##load the prostate data
x<-GDS1615$x
y<-GDS1615$y
x=x[which(y<3),]
y=y[which(y<3)]
obj.path <- dsda(x, y=y)