Aitchison Distance: Foundations and Applications in Data Analysis

Aitchison distance is a measure of dissimilarity designed specifically for compositional data, the kind of data where individual parts represent proportions of a whole and therefore always sum to a fixed total. Introduced by the statistician John Aitchison in the early 1980s as part of a broader framework for handling constrained data, the metric solves a deceptively tricky problem: standard statistical distances like Euclidean distance give misleading results when applied to percentages, proportions, or relative abundances. The Aitchison distance has since become a workhorse in fields ranging from microbiome research to geochemistry to insurance modeling, though it comes with its own practical headaches, particularly when datasets contain zeros.

Why Standard Metrics Fail on Proportional Data

Imagine you have data on the chemical composition of river water, measured as percentages of various dissolved minerals. Or counts of bacterial species in a stool sample, where each species is expressed as a fraction of total reads from a DNA sequencer. In both cases, the components are locked together: if one goes up, at least one other must go down, because they all have to add up to 100%. This fixed-sum constraint creates problems that are easy to overlook and surprisingly hard to fix.

The statistician Karl Pearson warned about this back in 1896. If you take three genuinely independent variables and convert them to ratios sharing a common denominator, those ratios will appear correlated with each other even when no real relationship exists. In genomics and microbiome research, this shows up constantly: two microbial species that have nothing to do with each other can look strongly correlated simply because they share the same total sequencing depth as a denominator.1Nature. propr: An R-package for Identifying Proportionally Abundant Features Using Compositional Data Analysis This spurious correlation is not just a theoretical nuisance. It leads researchers to draw wrong conclusions about which features are biologically linked.

The same constraint trips up distance measures. Euclidean distance, the straight-line distance between two points in space, treats each component as if it can vary independently. But in compositional data, the components cannot vary independently. Move one up and you mechanically push others down. Euclidean distance has no way to account for this, so it distorts the geometry of the data in ways that can make similar compositions look different and genuinely different compositions look similar.

What Aitchison’s Framework Introduced

John Aitchison’s solution, presented in a landmark 1982 paper to the Royal Statistical Society, was to transform the data using logarithms of ratios before doing any statistical analysis.2Statistical Science. Aitchison’s Compositional Data Analysis 40 Years on: A Reappraisal The logic is that if the raw proportions are constrained, you can break that constraint by looking at how components relate to each other through ratios. Taking logarithms of those ratios then spreads the data out in a way that makes standard statistical tools valid again.

The Aitchison distance itself is computed by applying a particular log-ratio transformation, the centered log-ratio (clr), and then calculating ordinary Euclidean distance in the transformed space. The clr transformation divides each component by the geometric mean of all components and then takes the logarithm. In plain terms, each component gets re-expressed as how far above or below average it sits on a log scale. The Aitchison distance between two compositions is then just the straight-line distance between these transformed profiles.3Bioinformatics. Understanding sequencing data as compositions: an outlook and review – Section: 4.4 Measures of distance

This might sound like a roundabout way to measure distance, but the transformation is what gives the metric its power. By converting proportions into log-ratios first, the Aitchison distance inherits properties that make it well-behaved for compositional data in ways that no standard distance metric can match.

Properties That Matter in Practice

The Aitchison distance has four properties that directly affect whether your analysis gives you sensible answers or garbage.

  • Scale invariance: If you multiply every component in a composition by the same constant, the Aitchison distance does not change. This matters enormously in sequencing studies, where total read counts vary from sample to sample for purely technical reasons. A metric that changes when the total changes is measuring sequencing depth, not biology.
  • Perturbation invariance: If you convert units, say from milligrams per liter to parts per million, the results stay the same. Equivalent representations of the same composition produce the same distance.
  • Permutation invariance: Reordering the components (listing calcium before sodium instead of after, for example) does not change the distance.
  • Sub-compositional dominance: The distance calculated from a subset of components is never larger than the distance calculated from the full composition. In other words, throwing away information can only reduce the distance, never inflate it.

Standard Euclidean distance lacks all four of these properties when applied to compositional data.3Bioinformatics. Understanding sequencing data as compositions: an outlook and review – Section: 4.4 Measures of distance Log-ratio transformations like the clr and the isometric log-ratio (ilr) impart these properties to any downstream analysis built on top of them.4Bioinformatics. Understanding sequencing data as compositions: an outlook and review – Section: 4.3 The log-ratio ‘normalization’ Scale invariance alone is worth the entire apparatus for anyone working with sequencing or spectroscopy data, where the absolute scale of measurements is essentially arbitrary.

Microbiome Research and the Dominance Problem

The field where Aitchison distance has arguably made the biggest practical difference is microbiome science. Researchers routinely compare microbial communities across hundreds or thousands of samples, and the choice of distance metric shapes almost every conclusion they draw. For decades, the default metric was Bray-Curtis dissimilarity, which compares communities based on shared abundance of species. Bray-Curtis works well in many ecological settings, but it has a blind spot when one taxon dominates a sample.

A 2025 study comparing metrics across both human and environmental microbiome datasets found that Bray-Curtis and other abundance-sensitive measures tend to emphasize differences driven primarily by the most abundant taxa. When a single species takes over a large share of the sequencing reads, Bray-Curtis essentially lets that dominant species drown out everything else. Aitchison distance, by contrast, compares taxa through their abundance ratios. So when one taxon balloons in proportion, the ratios among the less abundant taxa remain unaffected, and the underlying compositional structure of the community stays visible.5ISME Communications. Microbiome data: tell me which metrics and I will tell you which communities

This distinction is not academic. A method called robust Aitchison PCA, which combines the centered log-ratio transformation with a technique for handling missing values, was shown to produce better effect sizes, improved classification accuracy, and greater robustness to differences in sequencing depth compared to standard approaches on real microbiome datasets.6PubMed Central. A Novel Sparse Compositional Technique Reveals Microbial Perturbations When you are trying to detect a subtle shift in gut bacteria caused by a drug or a diet change, getting more signal out of the same data is the difference between a publishable finding and noise.

The metric can also reveal patterns that other distances miss entirely. A study of soil bacteria found that when communities were compared using Aitchison distance, microbial populations within the same agricultural field were, on average, as dissimilar as communities from entirely different farms. Bray-Curtis and Jaccard metrics, by contrast, showed the expected pattern of communities being more similar within fields than between farms.7Soil Biology and Biochemistry. Soil bacterial and fungal communities show within field heterogeneity that varies by land management and distance metric Whether that within-field heterogeneity is real biology or an artifact of the metric’s sensitivity is a genuine open question, but it illustrates how much the choice of distance shapes what researchers see.

Applications in Geochemistry

Geochemistry was actually the field where compositional data analysis first gained serious traction, and the Aitchison distance remains a staple there. Rock and water samples are naturally compositional: the concentrations of dissolved elements in a river, or the mineral percentages in a rock, always sum to some total. Analyzing these data with standard statistics produces the same spurious correlation problems Pearson identified.

A practical guide to compositional techniques in geochemical exploration demonstrated how log-ratio-based methods can discriminate between water samples from different geological sub-basins. By constructing specific balances between elements like sodium, calcium, and bicarbonate, researchers could link chemical differences directly to the underlying geology: silicate weathering in one sub-basin, volcanic rock interactions in another, carbonate dissolution in a third.8Journal of Geochemical Exploration. Exploring geochemical data using compositional techniques: A practical guide The framework lets geochemists interpret their data in terms of actual physical processes rather than statistical artifacts created by the constant-sum constraint.9Journal of Geochemical Exploration. Compositional data analysis in geochemistry: Are we sure to see what really occurs during natural processes?

Beyond the Natural Sciences

Aitchison distance has been finding its way into fields you might not expect. In insurance, for instance, companies need to allocate capital reserves across different business lines. The share of capital assigned to each line is compositional: the pieces must sum to total available capital. A recent study proposed using the Aitchison distance on the simplex as the optimality criterion for these allocations, ensuring that the capital shares assigned to individual units stay close to corresponding loss proportions in a way that respects the compositional geometry of the problem.10Statistical Methods & Applications. Compositional risk capital allocations Using Euclidean distance for the same task would treat a shift from 10% to 15% the same as a shift from 50% to 55%, even though the first represents a 50% relative increase and the second only a 10% relative increase. The Aitchison distance, operating on log-ratios, naturally captures relative changes rather than absolute ones.

Anywhere you have budget shares, market shares, portfolio weights, time-use data, or vote shares, you have compositional data. The broader compositional toolkit, including the Aitchison distance, applies in principle. Adoption outside the natural sciences has been slower, partly because the methods are less well known in economics and social science and partly because the datasets involved tend to have fewer components, which makes the distortions from ignoring the constraint less dramatic (though still present).

Dimensionality Reduction and Machine Learning

One of the most common things analysts do with distance matrices is feed them into ordination or clustering algorithms, essentially mapping high-dimensional data down to a few dimensions that humans can visualize. Principal component analysis is the classic workhorse for this, but running PCA directly on compositional data produces axes that are influenced by the spurious correlations baked into the constant-sum constraint.

Robust PCA applied to log-ratio-transformed compositions avoids this problem. By working in the coordinate system defined by the clr or ilr transformation, the singularity that would otherwise break PCA (because the clr values of a composition always sum to zero) can be managed, and the resulting principal components reflect genuine patterns of variation rather than artifacts.11PubMed Central. Robust principal component analysis for compositional tables The robust Aitchison PCA method mentioned in the microbiome section is one implementation of this idea, combining compositional transformation with matrix completion to handle the sparse, noisy data typical of sequencing studies.6PubMed Central. A Novel Sparse Compositional Technique Reveals Microbial Perturbations

For high-dimensional data like single-cell RNA sequencing, where you might have over 20,000 genes measured per cell, applying compositional methods gets more complicated. The geometry of compositional data in such high-dimensional spaces is not straightforwardly compatible with the Euclidean-space assumptions built into most downstream pipelines for clustering and trajectory analysis.12Journal of Translational Medicine. Compositional data modeling of high-dimensional single cell RNA-seq (CoDA-hd): its advantages over commonly used normalization approaches Researchers are actively working on bridging this gap, but it remains an area where the theory is ahead of routine practice.

The Zero Problem

The single biggest practical headache with Aitchison distance is zeros. The logarithm of zero is undefined, so any composition that contains a zero value cannot be log-ratio transformed without some kind of workaround. And zeros are everywhere in real data. In microbiome studies, most species are absent from most samples. In geochemistry, elements can fall below detection limits. In market-share data, some brands have zero sales in some regions.

Three broad strategies exist for dealing with this, and none of them is fully satisfying.

The simplest approach is zero replacement: swap each zero for a small positive value before transforming. Univariate replacement looks at each component individually, but this ignores the multivariate structure of the data. Multivariate replacement methods try to preserve relationships between components, but when zeros are abundant, they run into computational difficulties because too many components in each observation need to be imputed simultaneously.13Chemometrics and Intelligent Laboratory Systems. Comparison of zero replacement strategies for compositional data with large numbers of zeros A Bayesian approach uses the Dirichlet distribution to model the expected composition and replace zeros with small values derived from a principled statistical model, then multiplicatively adjusts the non-zero values so that the composition still sums correctly.14Statistical Modelling. Bayesian-multiplicative treatment of count zeros in compositional data sets

An entirely different strategy sidesteps log-ratios altogether. The chiPower transformation combines the standardization used in correspondence analysis with elements of the Box-Cox power transformation. For datasets with zeros, a power parameter can be chosen that brings the transformation as close as possible to a log-ratio transformation without ever requiring a logarithm of zero.15arXiv. The chiPower transformation: a valid alternative to logratio transformations in compositional data analysis It is a pragmatic compromise: you lose some of the clean theoretical properties of the Aitchison framework, but you gain the ability to handle data as-is without imputation.

In practice, most analysts end up choosing a zero-handling strategy based on how many zeros their data contain and how sensitive their results are to the choice. If zeros are rare, simple replacement with a small value usually works fine. If zeros dominate the dataset, as in single-cell sequencing where a matrix can be over 90% zeros, more careful treatment is essential, and the question of whether log-ratio methods are even the right starting point becomes legitimate.

When Aitchison Distance Is Not the Best Choice

Compositional data analysis can develop a bit of an ideological flavor: once you realize that standard methods are technically wrong for proportional data, it is tempting to reach for log-ratio tools everywhere. But “technically correct” and “practically best” are not always the same thing.

A 2025 benchmark of distance metrics for classifying immune cell populations from flow cytometry data tested Aitchison distance alongside Euclidean, Manhattan, cosine similarity, earth mover’s distance, and others. The task was to distinguish wild-type mice from mutants with known phenotypic changes. Cosine similarity performed best for separating wild-type from mutant samples while respecting small differences in already-small cell populations, and standardized Euclidean distance was best suited as input for machine learning classifiers. Both outperformed Aitchison distance in this context.16bioRxiv. Benchmark of Wide Range of Pairwise Distance Metrics for Automated Classification of Mouse Mutant Phenotypes from Flow Cytometry Data

The finding is a useful reminder that the best distance metric depends on what you are trying to detect. Aitchison distance excels when the meaningful biological signal lives in the ratios between components, which is often the case in microbial ecology and geochemistry. But when the signal lives in absolute shifts in small populations, or when the data structure rewards sensitivity to raw magnitude differences, other metrics can win. There is no universal best metric, and treating Aitchison distance as a default simply because the data are compositional can mean missing real patterns that a different metric would catch.

Software and Getting Started

If you want to actually compute Aitchison distances, the R ecosystem is the most mature option. The “compositions” package provides a unified framework for analyzing compositional data under four different geometric models, including the log-ratio approach that underpins the Aitchison distance.17Computers & Geosciences. “compositions”: A unified R package to analyze compositional data For microbiome-specific work, the DEICODE tool implements robust Aitchison PCA and integrates with the QIIME 2 pipeline. Python users can access compositional methods through scikit-bio and various community-contributed packages, though the tooling is less centralized than in R.

For anyone approaching compositional data analysis for the first time, the practical advice boils down to a short list: recognize when your data are compositional (whenever components sum to a fixed total or represent shares of something), choose a log-ratio transformation appropriate to your analysis, handle zeros deliberately rather than ignoring them, and compare your compositional results against a conventional analysis to understand what the framework changes. The differences can be subtle for some datasets and dramatic for others, and knowing which case you are in matters more than committing to one approach on principle.

Emeka Osei

Emeka Osei's expertise is combustion and fuel chemistry. He earned his PhD in chemistry at Imperial College London and spent 15 years in industrial energy research studying how fuels ignite, burn and form soot; he now evaluates hydrogen and biofuel blends. Dr. Osei writes about fire and flames, explosions, the energy content of fuels, reaction kinetics and the thermodynamics of engines.

Leave a Reply

Your email address will not be published. Required fields are marked *