Regularised and flexible discriminant analysis for compositional data using the alpha-transformation | R Documentation |

Regularised and flexible discriminant analysis for compositional data using the *α*-transformation.

alfa.rda(xnew, x, ina, a, gam = 1, del = 0) alfa.fda(xnew, x, ina, a)

`xnew` |
A matrix with the new compositional data whose group is to be predicted. Zeros are allowed, but you must be carefull to choose strictly positive vcalues of |

`x` |
A matrix with the available compositional data. Zeros are allowed, but you must be carefull to choose strictly positive vcalues of |

`ina` |
A group indicator variable for the avaiable data. |

`a` |
The value of |

`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. |

For the alfa.rda, the covariance matrix of each group is calcualted 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.

For the alfa.fda a flexible discriminant analysis is performed. See the R package **fda** for more details.

For the 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. |

For the alfa.fda a list including:

`mod` |
A fda object as returned by the command fda of the R package mda. |

`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 T.A. Wood (2016). Improved classification for compositional data using the *α*-transformation. Journal of classification, 33(2): 243-261.
https://arxiv.org/pdf/1106.1451.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

Hastie, Tibshirani and Buja (1994). Flexible Disriminant Analysis by Optimal Scoring. Journal of the American Statistical Association, 89(428):1255-1270.

```
rda, alfa, alfarda.tune, alfa.knn, alfa.nb, comp.nb, mix.compnorm
```

x <- as.matrix(iris[, 1:4]) x <- x / rowSums(x) ina <- iris[, 5] mod <- alfa.rda(x, x, ina, 0) table(ina, mod$est) mod2 <- alfa.fda(x, x, ina, 0) table(ina, mod2$est)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.