Skip to contents

Class centres and the pooled within-class scatter from FAST-MCD fits (Fastm) instead of sample moments. The pooled scatter is the sum of h_k S_k over classes divided by (sum h_k - g), the mcd-A pooling of rrcov::Linda; linear scores m_k' W^-1 x - m_k' W^-1 m_k / 2 + log prior_k. Identical to the Python arm morie.fn.robustda.

Usage

RobustLda(X, y, prior = NULL, newdata = NULL)

Arguments

X

Numeric matrix.

y

Class labels.

prior

Optional class priors (default class proportions).

newdata

Optional matrix to classify (default X).

Value

List: classes, centers, pooled_cov, prior, scores, predicted and apparent_error (resubstitution, when newdata is NULL).

References

Hawkins, D. M. and McLachlan, G. J. (1997). High-breakdown linear discriminant analysis. Journal of the American Statistical Association 92, 136-143.

Todorov, V. and Filzmoser, P. (2009). An object-oriented framework for robust multivariate analysis. Journal of Statistical Software 32(3).

Examples

X <- rbind(c(0, 0), c(1, 0), c(0, 1), c(1, 1), c(0.5, 0.4), c(9, 0), c(0.2, 0.8),
           c(5, 5), c(6, 5), c(5, 6), c(6, 6), c(5.5, 5.4), c(5.2, 5.8), c(-9, 9))
RobustLda(X, rep(0:1, each = 7))$predicted
#>  [1] 0 0 0 0 0 1 0 1 1 1 1 1 1 0