Title: | Robust Quadratic Discriminant Analysis |
---|---|
Description: | The minimum covariance determinant estimator is used to perform robust quadratic discriminant analysis, including cross-validation. References: Friedman J., Hastie T. and Tibshirani R. (2009). "The elements of statistical learning", 2nd edition. Springer, Berlin. <doi:10.1007/978-0-387-84858-7>. |
Authors: | Michail Tsagris [aut, cre] |
Maintainer: | Michail Tsagris <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0 |
Built: | 2024-12-06 01:37:48 UTC |
Source: | CRAN |
Robust quadratic discriminant analysis including cross-validation. The Minimum Covariance Determinant does most of the job. References: Friedman J., Hastie T. and Tibshirani R. (2009). The elements of statistical learning, 2nd edition. Springer, Berlin. <doi:10.1007/978-0-387-84858-7>.
Package: | robqda |
Type: | Package |
Version: | 1.0 |
Date: | 2024-12-03 |
License: | GPL-2 |
Michail Tsagris <[email protected]>.
Michail Tsagris [email protected]
Friedman J.H. (1989): Regularized Discriminant Analysis. Journal of the American Statistical Association 84(405): 165–175.
Friedman Jerome, Trevor Hastie and Robert Tibshirani (2009). The elements of statistical learning, 2nd edition. Springer, Berlin.
Tsagris M., Preston S. and Wood A.T.A. (2016). Improved classification for
compositional data using the -transformation.
Journal of Classification, 33(2): 243–261.
Cross-validation for the robust quadratic discriminant analysis.
robqda.cv(x, ina, nfolds = 10, quantile.used = floor((n + p + 1)/2), nsamp = "best", folds = NULL, stratified = TRUE, seed = NULL)
robqda.cv(x, ina, nfolds = 10, quantile.used = floor((n + p + 1)/2), nsamp = "best", folds = NULL, stratified = TRUE, seed = NULL)
x |
A matrix with the data. |
ina |
A group indicator variable for the avaiable data. |
nfolds |
The number of folds in the cross validation. |
folds |
If you have the list with the folds supply it here. You can also leave it NULL and it will create folds. |
quantile.used |
A number, the minimum number of the data points regarded as good points. |
nsamp |
The number of samples or "best", "exact", or "sample". The limit If "sample" the number chosen is min(5 * p, 3000), taken from Rousseeuw and Hubert (1997). If "best" exhaustive enumeration is done up to 5000 samples: if "exact" exhaustive enumeration will be attempted. |
stratified |
Do you want the folds to be created in a stratified way? TRUE or FALSE. |
seed |
You can specify your own seed number here or leave it NULL. |
Cross validation is performed to estimate the rate of accuracy in the robust quadratic discriminant analysis.
A list including:
per |
A vector with the estimated rate of correct classification for every fold. |
percent |
A matrix with the mean estimated rates of correct classification. |
runtime |
The time required by the cross-validation procedure. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Friedman Jerome, Trevor Hastie and Robert Tibshirani (2009). The elements of statistical learning, 2nd edition. Springer, Berlin.
x <- as.matrix(iris[, 1:4]) + matrix(rnorm(150 * 4), ncol = 4 ) mod <- robqda.cv(x, iris[, 5], nfolds = 5) mod
x <- as.matrix(iris[, 1:4]) + matrix(rnorm(150 * 4), ncol = 4 ) mod <- robqda.cv(x, iris[, 5], nfolds = 5) mod
Robust quadratic discriminant analysis.
robqda(xnew, x, ina, quantile.used = floor((n + p + 1)/2), nsamp = "best")
robqda(xnew, x, ina, quantile.used = floor((n + p + 1)/2), nsamp = "best")
xnew |
A matrix with the new data whose group is to be predicted. They have to be continuous. |
x |
A matrix with the available data. They have to be continuous. |
ina |
A group indicator variable for the avaiable data. |
quantile.used |
A number, the minimum number of the data points regarded as good points. |
nsamp |
The number of samples or "best", "exact", or "sample". The limit If "sample" the number chosen is min(5*p, 3000), taken from Rousseeuw and Hubert (1997). If "best" exhaustive enumeration is done up to 5000 samples: if "exact" exhaustive enumeration will be attempted. |
Robust quadratic discriminant analysis is performed where robust estimates (MCD method) of the multivariate location and scatter are used.
A list including:
mesos |
The estimated robust multivariate locations. |
sk |
The estimated robust scatter matrices. |
est |
The estimated group membership of the new data. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
P. Rousseeuw and M. Hubert (1997) Recent developments in PROGRESS. In L1-Statistical Procedures and Related Topics ed Y. Dodge, IMS Lecture Notes volume 31, pp. 201–214.
Friedman Jerome, Trevor Hastie and Robert Tibshirani (2009). The elements of statistical learning, 2nd edition. Springer, Berlin.
x <- as.matrix(iris[, 1:4]) + matrix(rnorm(150 * 4), ncol = 4 ) ina <- iris[, 5] mod <- robqda(x, x, ina) table(ina, mod$est)
x <- as.matrix(iris[, 1:4]) + matrix(rnorm(150 * 4), ncol = 4 ) ina <- iris[, 5] mod <- robqda(x, x, ina) table(ina, mod$est)