Cluster indices for the \(K\)--means algorithm for compositional data using the \(\alpha\)--transformation.
alfa.cikmeans(x, ncl = 10, trim = 0, a = seq(-1, 1, by = 0.1), max.iters = 50,
nstart = 10)A list inclusing:
A matrix with 9 columns and at least one row, where each column contains the value of a cluster validity index, whose minimal vlaue is preferred. Each row corresponds to a specific number of clusters, starting from 2 up to ncl.
The number of clusters selected based upon the minimal valued cluster validity indices.
A matrix with 24 columns and at least one row, where each column contains the value of a cluster validity index, whose minimal vlaue is preferred. Each row corresponds to a specific number of clusters, starting from 2 up to ncl.
The number of clusters selected based upon the maximal valued cluster validity indices.
If the argument "all" is TRUE, then the clustering indices of each observation for each number of clusters will be returned in a matrix, where each column corresponds to the clustering of each number of clusters.
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 and a series of cluster validity indices are computed.
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.cikmeans( y, ncl = 5, a = c(0, 0.5, 1) )
Run the code above in your browser using DataLab