Learn R Programming

CompositionalClust (version 1.2)

alfa.cikmeans: Cluster indices for the \(K\)--means algorithm for compositional data using the \(\alpha\)--transformation

Description

Cluster indices for the \(K\)--means algorithm for compositional data using the \(\alpha\)--transformation.

Usage

alfa.cikmeans(x, ncl = 10, trim = 0, a = seq(-1, 1, by = 0.1), max.iters = 50,
nstart = 10)

Value

A list inclusing:

min_crit

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.

best_min

The number of clusters selected based upon the minimal valued cluster validity indices.

max_crit

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.

best_max

The number of clusters selected based upon the maximal valued cluster validity indices.

cluster

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.

Arguments

x

A matrix with the compositional data.

ncl

The maximum number of clusters to try. The minimum number of clusters is 2.

trim

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

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.

max.iters

The maximum number of iterations allowed during the \(K\)--means algortihm.

nstart

How many random starts to perform?

Author

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Details

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.

References

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.

See Also

cikmeans

Examples

Run this code
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