Linda {rrcov} | R Documentation |
Robust linear discriminant analysis based on MCD and returns
the results as an object of class Linda
(aka constructor).
Linda(x, ...) ## Default S3 method: Linda(x, grouping, prior = proportions, tol = 1.0e-4, method = c("mcd", "mcdA", "mcdB", "mcdC", "fsa"), alpha=0.5, ...)
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 values are between 0.5 and 1 and the default is 0.5. |
... |
arguments passed to or from other methods |
details
Returns an S4 object of class Linda
Still an experimental version!
Valentin Todorov valentin.todorov@chello.at
Hawkins, D.M. and McLachlan, G.J. (1997) High-Breakdown Linear Discriminant Analysis, Journal of the American Statistical Association, 92, 136–143.
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
## 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")