# 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

${\displaystyle {\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:

${\displaystyle a_{n+1}={\frac {a_{n}+h_{n}}{2}},\quad a_{0}=x}$

and

${\displaystyle 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.

${\displaystyle {\bigg (}\prod _{i=1}^{n}x_{i}{\bigg )}^{1/n}=\exp \left[{\frac {1}{n}}\sum _{i=1}^{n}\ln x_{i}\right]}$

This is simply computing the arithmetic mean of the logarithm transformed values of ${\displaystyle 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)).