Package 'robqda'

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

Help Index


Robust Quadratic Discriminant Analysis

Description

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>.

Details

Package: robqda
Type: Package
Version: 1.0
Date: 2024-12-03
License: GPL-2

Maintainers

Michail Tsagris <[email protected]>.

Author(s)

Michail Tsagris [email protected]

References

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 α\alpha-transformation. Journal of Classification, 33(2): 243–261.


Cross-validation for the robust quadratic discriminant analysis

Description

Cross-validation for the robust quadratic discriminant analysis.

Usage

robqda.cv(x, ina, nfolds = 10, quantile.used = floor((n + p + 1)/2),
nsamp = "best", folds = NULL, stratified = TRUE, seed = NULL)

Arguments

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.

Details

Cross validation is performed to estimate the rate of accuracy in the robust quadratic discriminant analysis.

Value

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.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris [email protected].

References

Friedman Jerome, Trevor Hastie and Robert Tibshirani (2009). The elements of statistical learning, 2nd edition. Springer, Berlin.

See Also

robqda

Examples

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

Description

Robust quadratic discriminant analysis.

Usage

robqda(xnew, x, ina, quantile.used = floor((n + p + 1)/2), nsamp = "best")

Arguments

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.

Details

Robust quadratic discriminant analysis is performed where robust estimates (MCD method) of the multivariate location and scatter are used.

Value

A list including:

mesos

The estimated robust multivariate locations.

sk

The estimated robust scatter matrices.

est

The estimated group membership of the new data.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris [email protected].

References

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.

See Also

robqda.cv

Examples

x <- as.matrix(iris[, 1:4]) + matrix(rnorm(150 * 4), ncol = 4 )
ina <- iris[, 5]
mod <- robqda(x, x, ina)
table(ina, mod$est)