Geometric mean

The geometric mean of a collection of positive data is defined as the nth root of the product of all the members of the data set, where n is the number of members.

Calculation
The geometric mean of a data set [a1, a2, ..., an] is given by
 * $$\bigg(\prod_{i=1}^n a_i \bigg)^{1/n} = \sqrt[n]{a_1 \cdot a_2 \cdot \dots \cdot a_n}$$.

The geometric mean of a data set is smaller than or equal to the data set's arithmetic mean (the two means are equal if and only if all members of the data set are equal). This allows the definition of the arithmetic-geometric mean, a mixture of the two which always lies in between.

The geometric mean is also the arithmetic-harmonic mean in the sense that if two sequences (an) and (hn) are defined:
 * $$a_{n+1} = \frac{a_n + h_n}{2}, \quad a_0=x$$

and
 * $$h_{n+1} = \frac{2}{\frac{1}{a_n} + \frac{1}{h_n}}, \quad h_0=y$$

then an and hn will converge to the geometric mean of x and y.

Relationship with arithmetic mean of logarithms
By using logarithmic identities to transform the formula, we can express the multiplications as a sum and the power as a multiplication.


 * $$\bigg(\prod_{i=1}^nx_i \bigg)^{1/n} = \exp\left[\frac1n\sum_{i=1}^n\ln x_i\right]$$

This is simply computing the arithmetic mean of the logarithm transformed values of $$x_i$$ (i.e. the arithmetic mean on the log scale) and then using the exponentiation to return the computation to the original scale. I.e., it is the generalised f-mean with f(x) = ln x.

Therefore the geometric mean is related to the log-normal distribution. The log-normal distribution is a distribution which is normal for the logarithm transformed values. We see that the geometric mean is the exponentiated value of the arithmetic mean of the log transformed values, i.e. emean(ln(X)).