The \(K\)--means algorithm for compositional data using the \(\alpha\)--transformation.
alfa.kmeans(x, ncl = 10, trim = 0, a = seq(-1, 1, by = 0.1), max.iters = 50,
nstart = 10)A list with the results of the kmeans function for each value of \(\alpha\).
A matrix with the compositional data.
The maximum number of clusters to try. The minimum number of clusters is 2.
A number in [0, 1). If trim = 0, then the classical \(K\)--means algorithm is performed. If you chose a number higher than 0 then the trimmed \(K\)--means of Garcia-Escudero et al. (2008) is performed.
A vector with a grid of values of the power transformation, it has to be between -1 and 1. If zero values are present it has to be greater than 0. If a=0, the isometric log-ratio transformation is applied.
The maximum number of iterations allowed during the \(K\)--means algortihm.
How many random starts to perform?
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
The \(\alpha\)--transformation is applied to the compositional data, and then the \(K\)--means algorithm is performed.
Tsagris M. and Kontemeniotis N. (2025). Simplicial clustering using the \(\alpha\)--transformation. https://arxiv.org/pdf/2509.05945.
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
Garcia-Escudero Luis A., Gordaliza Alfonso, Matran Carlos, Mayo-Iscar Agustin. (2008). A general trimming approach to robust cluster analysis. Annals of Statistics 36(3): 1324--1345.
cikmeans
y <- as.matrix(iris[, 1:4])
y <- y / rowSums(y)
mod <- alfa.kmeans( y, ncl = 5, a = c(0, 0.5, 1) )
Run the code above in your browser using DataLab