The function gives the discrimintion of the potential classes based on Bayes rule and the Mahalanobis distance. This function adopts the function from Bingpei Wu, 2012, WMDB 1.0 with some corrections of the judement rule.

Mabayes(TrnX, TrnG, p = rep(1, length(levels(TrnG))), TstX = NULL, var.equal = FALSE, tol)

Arguments

TrnX

Training data

TrnG

Training label

p

prior or proportion of each class

TstX

Test data

var.equal

whether the variance or the weight is equal between classes

tol

The threshold or tolerance value for the covariance and distance

Details

Value

posterior and class

The posterior possibility and class labels

%% \item{comp2 }{Description of 'comp2'} %% ...

References

Bingpei Wu, 2012, WMDB 1.0: Discriminant Analysis Methods by Weight Mahalanobis Distance and bayes.

Ito, Y., Srinivasan, C., & Izumi, H. (2006, September). Discriminant analysis by a neural network with Mahalanobis distance. In International Conference on Artificial Neural Networks (pp. 350-360). Springer, Berlin, Heidelberg.

Wölfel, M., & Ekenel, H. K. (2005, September). Feature weighted Mahalanobis distance: improved robustness for Gaussian classifiers. In 2005 13th European signal processing conference (pp. 1-4). IEEE.

Author

qinxinghu@gmail.com

Note

See also

Examples

data(iris) train=Mabayes(iris[,1:4],iris[,5],TstX= iris[1:10,1:4],tol = 1)