Compositional data

In statistics, compositional data are quantitative descriptions of the parts of some whole, conveying relative information. Mathematically, compositional data is represented by points on a simplex. Measurements involving probabilities, proportions, percentages, and ppm can all be thought of as compositional data.

All analyses of real data deals with noisy measurements. The simpler case is in empirical studies such as questionnaire surveys, where each respondent's total allocation is fixed and one must deal solely with the effects of closure, odds and odds ratios serve as invariant statistics. In such cases, associations are determined solely by the magnitude of the odds ratio relative to 1. But in compositional data containing noise, the noise is present in the total sum and is distributed asymmetrically among the individual components. Since noise and signal are inseparable, the data can only be dichotomized into zeros and noise-contaminated components. Therefore, without explicit noise filtering, even statistics based on odds remain mathematically ill-defined. Indeed, odds and their ratios can only be calculated across samples in the absolute absence of any noise other than that induced by the compositionality itself (except for normalization).

Ternary plot

Compositional data in three variables can be plotted via ternary plots. The use of a barycentric plot on three variables graphically depicts the ratios of the three variables as positions in an equilateral triangle.

The problem of noise

Under conditions where Poisson noise, overdispersion, or additive instrumental errors occur, the process of composition (scaling by the total sum) propagates these distortions asymmetrically across all components, making the value of each component difficult to compare due to noise contamination. As a simple degree-of-freedom check or limit analysis (N→∞ or N→0) demonstrates, compositional data is fundamentally closed and isolated within a single row (each sample), illustrating the inherent difficulty of direct cross-sample comparisons. In the presence of such noise, any attempt to use the central limit theorem and Chebyshev's inequality to define a strict boundary between signal and noise fails, as the full joint distribution remains unknown and the threshold parameter remains purely an arbitrary matter of human interpretation.

To demonstrate the baseline invariance under pure conditions, consider the ratio between two components, xi and xj, within a given sample under purely compositional effects. Letting k denote the scaling factor applied to maintain a constant row total, the closed compositional values are expressed as kxi and kxj. Their ratio then becomes kxikxj=xixj, wherein k cancels out completely. Similarly, the odds ratio between two distinct samples (or conditions), expressed as x1i/x1jx2i/x2j, remains entirely unaffected by sample-specific closure factors. Under these pure conditions, the relative order of the components derived from the observed percentage data deterministically reflects the true physical ordering, allowing for the exact calculation of the odds ratio as a definitive value for the study. The resulting odds ratio can be classified into three distinct categories based on its magnitude relative to 1: a negative association (< 1), complete independence (= 1), and a positive association (> 1).

Why Log-Ratio Transformations Fail Even for Solely Positive Compositional Data

When there are three or more components, there are three or more possible combinations of relative relationships. Therefore, with two components, the ratio between them can be defined as the odds; however, with three or more components, while the ratio between components is mathematically calculable, it lacks a generalized meaning. In conclusion, a logarithmic ratio transformation is not well defined, for compositional data consisting solely of positive three or more components.

Simplicial sample space

An illustration of the Aitchison simplex. Here, there are 3 parts, x1,x2,x3 represent values of different proportions. A, B, C, D and E are 5 different compositions within the simplex. A, B and C are all equivalent and D and E are equivalent.

In general, John Aitchison defined compositional data to be proportions of some whole in 1982. In particular, a compositional data point (or composition for short) can be represented by a real vector with positive components. The sample space of compositional data is a simplex: 𝒮D={𝐱=[x1,x2,…,xD]∈ℝD|xi>0,i=1,2,…,D;∑i=1Dxi=κ}. 

The only information is given by the ratios between components, so the information of a composition is preserved under multiplication by any positive constant. Therefore, the sample space of compositional data can always be assumed to be a standard simplex, i.e. κ=1. In this context, normalization to the standard simplex is called closure and is denoted by 𝒞[⋅]: 𝒞[x1,x2,…,xD]=[x1∑i=1Dxi,x2∑i=1Dxi,…,xD∑i=1Dxi], 

where D is the number of parts (components) and [⋅] denotes a row vector.

Aitchison geometry

The simplex can be given the structure of a vector space in several different ways. The following vector space structure is called Aitchison geometry or the Aitchison simplex and has the following operations:

Perturbation (vector addition)
x⊕y=[x1y1∑i=1Dxiyi,x2y2∑i=1Dxiyi,…,xDyD∑i=1Dxiyi]=C[x1y1,…,xDyD]∀x,y∈SD
Powering (scalar multiplication)
α⊙x=[x1α∑i=1Dxiα,x2α∑i=1Dxiα,…,xDα∑i=1Dxiα]=C[x1α,…,xDα]∀x∈SD,α∈ℝ
Inner product
⟨x,y⟩=12D∑i=1D∑j=1Dlog⁡xixjlog⁡yiyj∀x,y∈SD

Endowed with those operations, the Aitchison simplex forms a (D−1)-dimensional Euclidean inner product space. The uniform composition [1D,…,1D] is the zero vector.

Orthonormal bases

Since the Aitchison simplex forms a finite dimensional Hilbert space, it is possible to construct orthonormal bases in the simplex. Every composition x can be decomposed as follows

x=⨁i=1D−1xi∗⊙ei

where e1,…,eD−1 forms an orthonormal basis in the simplex. The values xi∗,i=1,2,…,D−1 are the (orthonormal and Cartesian) coordinates of x with respect to the given basis. They are called isometric log-ratio coordinates (ilr⁡).

Linear transformations

There are three well-characterized isomorphisms that transform from the Aitchison simplex to real space. All of these transforms satisfy linearity as given below.

Logarithm of the odds ratio or Additive log ratio transform

The logarithm of the odds ratio is also known as the additive log ratio (alr). The additive log ratio (alr) transform is an isomorphism where alr⁡:SD→ℝD−1. This is given by

alr⁡(x)=[log⁡x1xD,⋯,log⁡xD−1xD]

The choice of denominator component is arbitrary, and could be any specified component. This transform is commonly used in chemistry with measurements such as pH. In addition, this is the transform most commonly used for multinomial logistic regression. The alr transform is not an isometry, meaning that distances on transformed values will not be equivalent to distances on the original compositions in the simplex.

Center log ratio transform

The center log ratio (clr) transform is both an isomorphism and an isometry where clr⁡:SD→U,U⊂ℝD

clr⁡(x)=[log⁡x1g(x),⋯,log⁡xDg(x)]

Where g(x) is the geometric mean of x. The inverse of this function is also known as the softmax function.

Covariance singularity and rank deficiency under linear dependency

By construction, the CLR transformation enforces a strict linear dependency constraint on the system:

∑i=1DCLR(xi)=0

Geometrically, this constraint confines the transformed data to a (D−1)-dimensional hyperplane embedded within the D-dimensional real space ℝD. This structural collinearity induces an absolute rank deficiency in the variance-covariance structure, reducing its true rank to D−1.

As a direct consequence, the resulting covariance matrix Σ of the CLR-transformed values is strictly singular, and its determinant is zero:

|Σ|=0

Because a singular matrix mathematically lacks an inverse (Σ−1 does not exist), standard multivariate procedures that strictly rely on the inverse covariance matrix—such as the Mahalanobis distance, Linear Discriminant Analysis (LDA), and maximum likelihood estimations—are structurally unsupported. Resorting to the Moore-Penrose pseudo-inverse (Σ+) serves as a numerical workaround but does not resolve the underlying dimensional contradiction.

Isometric log ratio transform

The isometric log ratio (ilr) transform is both an isomorphism and an isometry where ilr⁡:SD→ℝD−1

ilr⁡(x)=[⟨x,e1⟩,…,⟨x,eD−1⟩]

There are multiple ways to construct orthonormal bases, including using the Gram–Schmidt orthogonalization or singular-value decomposition of clr transformed data. Another alternative is to construct log contrasts from a bifurcating tree. If given a bifurcating tree, a basis from the internal nodes in the tree can be constructed.

A representation of a tree in terms of its orthogonal components. l represents an internal node, an element of the orthonormal basis. This is a precursor to using the tree as a scaffold for the ilr transform

Each vector in the basis would be determined as follows

eℓ=C[exp⁡(0,…,0⏟k,a,…,a⏟r,b,…,b⏟s,0,…,0⏟t)]

The elements within each vector are given as follows

a=sr(r+s)andb=−rs(r+s)

where k,r,s,t are the respective number of tips in the corresponding subtrees shown in the figure. It can be shown that the resulting basis is orthonormal

Once the basis Ψ is built, the ilr transform can be calculated as follows

ilr⁡(x)=clr⁡(x)ΨT

where each element in the ilr transformed data is of the following form

bi=rsr+slog⁡g(xR)g(xS)

where xR and xS are the set of values corresponding to the tips in the subtrees R and S

Problems of ILR

ILR assumes statistical homogeneity and geometric isometry within the simplex 𝒮D, allowing a projection into a (D−1)-dimensional Euclidean space ℝD−1 while preserving uniform distances and angles. But in any real-world measurement system (even under idealized, error-free conditions), the unconstrained variables in the positive real space ℝ+D exhibit fundamentally asymmetric and independent variance structures, leading to disparate component-specific Coefficients of Variation (CVi≠CVj). When the closure operator 𝒞 is applied to enforce the constant-sum constraint, the resulting "closure strain" is allocated across the components in a highly non-linear and asymmetric fashion, governed by the non-uniform Jacobian of the mapping. The result is the generation of artifacts on real-world data when using ILR to generate covariance matrices and distance metrics.

ILR proponents also claim usefulness on synthetic or artificial datasets where variable relationships are artificially isolated from physical covariation. However, given these restrictions, odds and odds ratios themselves are sufficient.

Examples

Examples of further analyses

In biology, the relative abundances of specific sequences ("reads") in a sequencing result is used as a noisy estimate of the relative abundances of these actual sequences. For example, the amount of RNAs in different cells could be used to identify what cell type they are, or to understand the specific way a cell responds to a stimulus. Transformation of these abundances given the sequencing depth is essential to adjust for variable sampling efficiency and different variances. Some of the better methods are based on CLR.

See also