Lably
Skip to content

Geometric mean

N-th root of the product of n numbers

  • 13 min read
  • 3 chapters
  • 1 lab on Lably

Learn it on Lably

a1a2⋯antn.

Hence, the geometric mean of two numbers is the square root of their product, for example with numbers ⁠2⁠ and ⁠8⁠ the geometric mean is 2⋅8=16=4. The geometric mean of the three numbers is the cube root of their product, for example with numbers ⁠1⁠, ⁠12⁠, and ⁠18⁠, the geometric mean is 1⋅12⋅183=2163=6.

When the collection of numbers and their geometric mean are plotted in logarithmic scale, the geometric mean is transformed into an arithmetic mean, so the geometric mean can equivalently be calculated by taking the natural logarithm ⁠ln⁠ of each number, finding the arithmetic mean of the logarithms, and then returning the result to linear scale by using the exponential function ⁠exp⁠,

a1a2⋯antn=exp⁡(ln⁡a1+ln⁡a2+⋯+ln⁡ann).

The geometric mean is useful whenever the quantities to be averaged combine multiplicatively, such as population growth rates or interest rates of a financial investment. Suppose for example a person invests $1000 and achieves annual returns of +10%, −12%, +90%, −30% and +25%, giving a final value of $1609. The average percentage growth is the geometric mean of the annual growth ratios (1.10, 0.88, 1.90, 0.70, 1.25), namely 1.0998, an annual average growth of 9.98%. The arithmetic mean of these annual returns is 16.6% per annum, which is not a meaningful average because growth rates do not combine additively.

The geometric mean can be understood in terms of geometry. The geometric mean of two numbers, a and b, is the length of one side of a square whose area is equal to the area of a rectangle with sides of lengths a and b. Similarly, the geometric mean of three numbers, a, b, and c, is the length of one edge of a cube whose volume is the same as that of a cuboid with sides whose lengths are equal to the three given numbers.

The geometric mean is one of the three classical Pythagorean means, together with the arithmetic mean and the harmonic mean. For all positive data sets containing at least one pair of unequal values, the harmonic mean is always the least of the three means, while the arithmetic mean is always the greatest of the three and the geometric mean is always in between (see QM-AM-GM-HM inequalities).

Formulation

The geometric mean of a data set {a1,a2,…,an} is given by

(∏i=1nai)1n=a1a2⋯antn.

That is, the nth root of the product of the elements. For example, for 1,2,3,4, the product 1⋅2⋅3⋅4 is 24, and the geometric mean is the fourth root of 24, approximately 2.213.

Formulation using logarithms

The geometric mean can also be expressed as the exponential of the arithmetic mean of logarithms. By using logarithmic identities to transform the formula, the multiplications can be expressed as a sum and the power as a multiplication:

When a1,a2,…,an>0 (∏i=1nai)1n=exp⁡(1n∑i=1nln⁡ai), since |ln⁡a1a2⋯antn=1nln⁡(a1a2⋯an)=1n(ln⁡a1+ln⁡a2+⋯+ln⁡an).

This is sometimes called the log-average (not to be confused with the logarithmic average). It is simply the arithmetic mean of the logarithm-transformed values of ai (i.e., the arithmetic mean on the log scale), using the exponentiation to return to the original scale, i.e., it is the generalized f-mean with f(x)=log⁡x. A logarithm of any base can be used in place of the natural logarithm. For example, the geometric mean of ⁠1⁠, ⁠2⁠, ⁠8⁠, and ⁠16⁠ can be calculated using logarithms base 2:

1⋅2⋅8⋅164=2(log21+log22+log28+log216)/4=2(0+1+3+4)/4=22=4.

Related to the above, it can be seen that for a given sample of points a1,…,an, the geometric mean is the minimizer of

f(a)=∑i=1n(log⁡ai−log⁡a)2=∑i=1n(log⁡aia)2,

whereas the arithmetic mean is the minimizer of

f(a)=∑i=1n(ai−a)2.

Thus, the geometric mean provides a summary of the samples whose exponent best matches the exponents of the samples (in the least squares sense).

In computer implementations, naïvely multiplying many numbers together can cause arithmetic overflow or underflow. Calculating the geometric mean using logarithms is one way to avoid this problem.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Statistics and probability