Learn R Programming

rrcov (version 0.4-08)

Linda: Robust Linear Discriminant Analysis

Description

Robust linear discriminant analysis based on MCD and returns the results as an object of class Linda (aka constructor).

Usage

Linda(x, ...)

## S3 method for class 'default':
Linda(x, grouping, prior = proportions, tol = 1.0e-4,
                 method = c("mcd", "mcdA", "mcdB", "mcdC", "fsa"),
                 alpha=0.5, ...)

Arguments

x
a matrix or data frame containing the explanatory variables (training set).
grouping
grouping variable: a factor specifying the class for each observation.
prior
prior probabilities, default to the class proportions for the training set.
tol
tolerance
method
method
alpha
this parameter measures the fraction of outliers the algorithm should resist. In MCD alpha controls the size of the subsets over which the determinant is minimized, i.e. alpha*n observations are used for computing the determinant. Allowed
...
arguments passed to or from other methods

Value

  • Returns an S4 object of class Linda

Warning

Still an experimental version!

Details

details

References

Todorov V. (2007) Robust selection of variables in linear discriminant analysis, Statistical Methods and Applications, 15, 395--407, doi:10.1007/s10260-006-0032-6. Todorov, V. and Pires, A.M. (2007) Comparative Performance of Several Robust Linear Discriminant Analysis Methods, REVSTAT Statistical Journal, 5, p 63--83

See Also

CovMcd

Examples

Run this code
## Example anorexia
library(MASS)
data(anorexia)

## start with the classical estimates
lda <- LdaClassic(Treat~., data=anorexia)
predict(lda)@classification

## try now the robust LDA with the default method (MCD with pooled whitin cov matrix)
rlda <- Linda(Treat~., data= anorexia)
predict(rlda)@classification

## try the other methods
Linda(Treat~., data= anorexia, method="mcdA")
Linda(Treat~., data= anorexia, method="mcdB")
Linda(Treat~., data= anorexia, method="mcdC")

## try the Hawkins&McLachlan method
## use the default method
grp <- anorexia[,1]
grp <- as.factor(grp)
x <- anorexia[,2:3]
Linda(x, grp, method="fsa")

Run the code above in your browser using DataLab