Description Usage Arguments Details Value Author(s) References See Also Examples
Performs K-fold cross validation for msda
and returns the best tuning parameter λ in the user-specified or automatically generated choices.
1 2 |
x |
Input matrix of predictors. |
y |
Class label. For |
model |
Method type. The |
nfolds |
Number of folds. Default value is 5. Although |
lambda |
User-specified |
lambda.opt |
The optimal criteria when multiple elements in |
... |
other arguments that can be passed to |
The function cv.msda
runs function msda
nfolds+1
times. The first one fits model on all data. If lambda
is specified, it will check if all lambda
satisfies the constraints of dfmax
and pmax
in msda
. If not, a lambda
sequence will be generated according to lambda.factor
in msda
. Then the rest nfolds
many replicates will fit model on nfolds-1
many folds data and predict on the omitted fold, repectively. Return the lambda
with minimum average cross validation error and the largest lambda
within one standard error of the minimum.
Similar as msda
, user can specify which method to use by inputing argument model
. Without specification, the function can automatically decide the method by number of classes and variables.
An object of class cv.dsda
or cv.msda.original
or cv.msda.modified
is returned, which is a
list with the ingredients of the cross-validation fit.
lambda |
The actual |
cvm |
The mean of cross validation errors for each |
cvsd |
The standard error of cross validaiton errors for each |
lambda.min |
The |
lambda.1se |
The largest value of |
model.fit |
A fitted |
Yuqing Pan, Qing Mai, Xin Zhang
Mai, Q., Zou, H. and Yuan, M. (2012), "A direct approach to sparse discriminant analysis in ultra-high dimensions." Biometrica, 99, 29-42.
Mai, Q., Yang, Y., and Zou, H. (2017), "Multiclass sparse discriminant analysis." Statistica Sinica, in press.
URL: https://github.com/emeryyi/msda
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.