Regularised discriminant analysis for Euclidean data {Compositional} | R Documentation |
Regularised discriminant analysis for Euclidean data.
rda(xnew, x, ina, gam = 1, del = 0)
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. |
gam |
This is a number between 0 and 1. It is the weight of the pooled covariance and the diagonal matrix. |
del |
This is a number between 0 and 1. It is the weight of the LDA and QDA. |
The covariance matrix of each group is calculated and then the pooled covariance matrix. The spherical covariance matrix consists of the average of the pooled variances in its diagonal and zeros in the off-diagonal elements. gam is the weight of the pooled covariance matrix and 1-gam is the weight of the spherical covariance matrix, Sa = gam * Sp + (1-gam) * sp. Then it is a compromise between LDA and QDA. del is the weight of Sa and 1-del the weight of each group covariance group. This function is a wrapper for alfa.rda.
A list including:
prob |
The estimated probabilities of the new data of belonging to each group. |
scores |
The estimated socres of the new data of each group. |
est |
The estimated group membership of the new data. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Giorgos Athineou <gioathineou@gmail.com>.
Friedman Jerome, Trevor Hastie and Robert Tibshirani (2009). The elements of statistical learning, 2nd edition. Springer, Berlin
Tsagris Michail, Simon Preston and Andrew TA Wood (2016). Improved classification for compositional data using the α-transformation. Journal of classification, 33(2): 243-261. http://arxiv.org/pdf/1106.1451.pdf
x <- as.matrix(iris[, 1:4]) ina <- iris[, 5] mod <- rda(x, x, ina) table(ina, mod$est)