# Compositional Data and Machine Learning

One of my features is compositional of nature, represented by a vector [p1, p2, p3]. Each vector represents an emotion and each vector sums up to unity. Eg: [anger=0.10, sad=0.10, happy=0.80].

1) I read about natural constraints of compositional data. What are these?

2) These constraints force us to transform compositional data using isometric/additive/centered logratio before they become useable, why is this necessary?

I know that for a lot of models, correlated features are ill-advised. Is this why we transform compositional data?

Regarding the constraints

You gave a good example of what a compositional data sample looks like. These 'natural constraints' as you call them are simply the restrictions on the sample space that compositional data implies.

A vector $$\mathbf{x} = [x_1, x_2,...,x_D]$$ must satisfy two requirements to fit into a 'compositional sample space', which is a D-dimensional simplex.

1. $$x_i \geq 0 \: \forall \: i=1,...,D$$ , that is all elements of the vector must be greater or equal zero
2. $$\sum_{j=1}^{D}x_j=\mathcal{k}$$, so all elements of $$\mathbf{x}$$ must sum up to $$\mathcal{k}$$, which is the 'total' of the composition. In your example this is 1, it could as well be 100, 1000 or any arbitrary number $$\geq 0$$.

Why transformations are often used with compositional data

As Aitchison states in 'The Statistical Analysis of Compositional Data'

"It is argued that the statistical analysis of such data has proved difficult because of a lack both of concepts of independence and of rich enough parametric classes of distributions in the simplex."

Aitchison elaborates on approaches to analysis of data in the simplex, while on the other hand Egozcue et al. (ref. 3 below) proposed the isometric log-ratio transformation to transform the data from a D-dimensional simplex to $$\mathbb{R}^{D-1}$$, in which the application of conventional statistical methods becomes possible.

Further references:

1. Short summary of the most important concepts for compositional data analysis. I found this useful as a quick cheat sheet, but it does require some of the other two sources for initial understanding of the theory.
2. Lecture notes on the topic of compositional data analysis.
3. Egozcue et al. went into a lot of mathematical detail to motivate the necessity of the ilr transformation, which I can't and won't replicate here.