User:Soluvo/sandbox/Geometric

__NOINDEX__

Title: Arithmetic mean vs. Geometric mean: Examples

The arithmetic mean and the geometric mean are two of the three Pythagorean means. The third one is the harmonic mean.

Objective of this article
Many people are familiar with the arithmetic mean as well as how to calculate and apply it. Often the word "average" refers to the arithmetic mean. It is the sum of the numbers divided by how many numbers are being averaged. However, the family of the three Pythagorean means includes two more means, the geometric mean and the harmonic mean.

This articles focuses on the comparison of the arithmetic and the geometric mean. The objective of this article is to provide readers with examples of the usage of the arithmetic and geometric means and to show in which situations it is beneficial to use which of these two means.

The three Pythagorean means
The three Pythagorean means arithmetic mean (AM), geometric mean (GM) and the harmonic mean (HM) are defined by:



\begin{align} \operatorname{AM} \left( x_1,\; \ldots,\; x_n \right) &= \frac{1}{n} \left(x_1 + \;\cdots\; + x_n\right) \\[9pt] \operatorname{GM} \left( x_1,\; \ldots,\; x_n \right) &= \sqrt[n]{\left\vert x_1 \times \,\cdots\, \times x_n \right\vert} \\[9pt] \operatorname{HM} \left( x_1,\; \ldots,\; x_n \right) &= \frac{n}{\displaystyle \frac{1}{x_1} + \;\cdots\; + \frac{1}{x_n}} \end{align} $$ There is an ordering to the Pythagorean means (if all of the $$ x_i $$ are positive)
 * $$ \min \leq \operatorname{HM} \leq \operatorname{GM} \leq \operatorname{AM} \leq \max $$

with equality holding if and only if the $$x_i$$ are all equal.

When to use which?


 * Which mean to use and when? - Stats Stack Exchange
 * When is it most appropriate to take the arithmetic mean vs. geometric mean vs. harmonic mean? - Quora

Archives:
 * Stackexchange: Archive 1, Archive 2, Archive 3, Archive 4
 * Quora.com: Archive 1, Archive 2, Archive 3

Example 1
Let's suppose we are analyzing the fictional company A. For this analysis we are trying to come up with an overall rating, consisting of only a single number taken as representative of multiple individual ratings of company A. Should the arithmetic mean or geometric mean be used for the calculation of this overall rating?

In this example 1 the overall rating consists of two individual ratings, which are given. These two ratings are the environmental rating and the financial rating of company A.

The environmental rating is given on a scale from 1 to 5, with 1 being the worst and 5 being the best environmental rating. It is similar to the 1-to-5-star rating on Amazon.com.

The financial rating is given on a scale from 0 to 100, with 0 being the worst and 100 being the best financial rating. It is similar to a percentage scale.

Example 1.1
The arithmetic mean is:
 * $$ \operatorname{AM} ( 2, \; 40 ) \;=\; \frac{1}{2}(2 + 40) \;=\; \frac{1}{2}(42) \;=\; 21 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 2, \; 40 ) \;=\; \sqrt[2]{2 \times 40} \;=\; \sqrt[2]{80} \;\approx\; 8.9443 $$

Example 1.2
The arithmetic mean is:
 * $$ \operatorname{AM} ( 3, \; 40 ) \;=\; \frac{1}{2} (3 + 40) \;=\; \frac{1}{2}(43) \;=\; 21.5 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 3, \; 40 ) \;=\; \sqrt[2]{3 \times 40} \;=\; \sqrt[2]{120} \;\approx\; 10.9545 $$

Example 1.3
The arithmetic mean is:
 * $$ \operatorname{AM} ( 2, \; 60 ) \;=\; \frac{1}{2} (2 + 60) \;=\; \frac{1}{2}(62) \;=\; 31 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 2, \; 60 ) \;=\; \sqrt[2]{2 \times 60} \;=\; \sqrt[2]{120} \;\approx\; 10.9545 $$

Conclusion
In example 1.1 we calculated the overall rating as arithmetic mean and geometric mean from the two given aspect ratings.

While in example 1.2 the environmental rating has increased by 50 percent, in exmaple 1.3 the financial rating has increased by 50 percent. However the geometric mean for 1.2 and 1.3 have remained the same. It doesn't matter which aspect changes, as long as the relative change is equal the geometric mean will remain equal.

Example 2
Still the analysis of company A. Now with the overall rating consisting of three factors. 2 aspects change.

Example 2.1
The arithmetic mean is:
 * $$ \operatorname{AM} ( 2, \; 40, \; 6 ) \;=\; \frac{1}{3}(2 + 40 + 6) \;=\; \frac{1}{3}(48) \;=\; 16 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 2, \; 40, \; 6 ) \;=\; \sqrt[3]{2 \times 40 \times 6} \;=\; \sqrt[3]{480} \;\approx\; 7.8297 $$

Example 2.2
The arithmetic mean is:
 * $$ \operatorname{AM} ( 3, \; 80, \; 6 ) \;=\; \frac{1}{3}(3 + 80 + 6) \;=\; \frac{1}{3}(89) \;\approx\; 29.6667 $$

The geometric mean is:
 * $$\operatorname{GM} ( 3, \; 80, \; 6 ) \;=\; \sqrt[3]{3 \times 80 \times 6} \;=\; \sqrt[3]{1440} \;\approx\; 11.2924 $$

Example 2.3
The arithmetic mean is:
 * $$ \operatorname{AM} ( 4, \; 40, \; 9 ) \;=\; \frac{1}{3}(4 + 40 + 9) \;=\; \frac{1}{3}(53) \;\approx\; 17.6667 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 4, \; 40, \; 9 ) \;=\; \sqrt[3]{4 \times 40 \times 9} \;=\; \sqrt[3]{1440} \;\approx\; 11.2924 $$

Conclusion
In the step from example 1 to example 2, we introduced a third individual ratings. This time, two parameters change instead of one.

Two individual ratings change. While in 2.2 the change is +x and +y, in 2.3 the change is +y and +x. The geometric mean remains the same.

Example 3
xyz

Example 3.1
The arithmetic mean is:
 * $$ \operatorname{AM} ( 2, \; 40 ) \;=\; \frac{1}{2}(2 + 40) \;=\; \frac{1}{2}(42) \;=\; 21 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 2, \; 40 ) \;=\; \sqrt[2]{2 \times 40} \;=\; \sqrt[2]{80} \;\approx\; 8.9443 $$

Example 3.2
The arithmetic mean is:
 * $$ \operatorname{AM} ( 3, \; 80 ) \;=\; \frac{1}{2}(3 + 80) \;=\; \frac{1}{2}(83) \;=\; 41.5 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 3, \; 80 ) \;=\; \sqrt[2]{3 \times 80} \;=\; \sqrt[2]{240} \;\approx\; 15.4919 $$

Example 3.3
The arithmetic mean is:
 * $$ \operatorname{AM} ( 4, \; 60 ) \;=\; \frac{1}{2}(4 + 60) \;=\; \frac{1}{2}(64) \;=\; 32 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 4, \; 60 ) \;=\; \sqrt[2]{4 \times 60} \;=\; \sqrt[2]{240} \;\approx\; 15.4919 $$

Example 3.4
The arithmetic mean is:
 * $$ \operatorname{AM} ( 3.5, \; 70 ) \;=\; \frac{1}{2}(3.5 + 70) \;=\; \frac{1}{2}(73.5) \;=\; 36.75 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 3.5, \; 70 ) \;=\; \sqrt[2]{3.5 \times 70} \;=\; \sqrt[2]{245} \;\approx\; 15.6525 $$

Conclusion
In example 3 we go back to two parameters. As we can see in 2.2 and 2.3 it doesnt matter which parameters change, the gm remains the same.

However this is not true if the parameters change by different relative changes.

Example 4
xyz

Example 4.1
The arithmetic mean is:
 * $$ \operatorname{AM} ( 2, \; 40 ) \;=\; \frac{1}{2}(2 + 40) \;=\; \frac{1}{2}(42) \;=\; 21 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 2, \; 40 ) \;=\; \sqrt[2]{2 \times 40} \;=\; \sqrt[2]{80} \;\approx\; 8.9443 $$

Example 4.2
The arithmetic mean is:
 * $$ \operatorname{AM} ( 1, \; 60 ) \;=\; \frac{1}{2}(1 + 60) \;=\; \frac{1}{2}(61) \;=\; 30.5 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 1, \; 60 ) \;=\; \sqrt[2]{1 \times 60} \;=\; \sqrt[2]{60} \;\approx\; 7.7460 $$

Example 4.3
The arithmetic mean is:
 * $$ \operatorname{AM} ( 1, \; 80 ) \;=\; \frac{1}{2}(1 + 80) \;=\; \frac{1}{2}(81) \;=\; 40.5 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 1, \; 80 ) \;=\; \sqrt[2]{1 \times 80} \;=\; \sqrt[2]{80} \;\approx\; 8.9443 $$

Conclusion
in exmaple 4 we remain with two parameters. Here we compare what happens when one paraemter is increased and the other one decreased and how much of a change of one parameter is needed to offset the negative change of the other one.

when the relative change is equal, losses weigh more than gains.


 * $$ 1 \;\;=\;\; 2 \times \frac{1}{2} \;\;=\;\; \frac{2}{1} \times \frac{1}{2} \;\;=\;\; \frac{1}{1} \times \frac{1}{1} \;\;=\;\; 1 $$

Example 5
Company A and company B are compared by their environmental rating.

in this case not the different values for the same company are compared but the same values for different companies.
 * Before: company A is compared to itself in the factors environment, etc.
 * Now: five companies a, b, c, d, e are compared by their environment rating, but only by this one

In ex 5.1 two companies are compared by their environmetnal rating, in ex 5.2 five companies are compared by their environmental rating.

Example 5.1
The arithmetic mean is:
 * $$ \operatorname{AM} ( 3, \; 3 ) \;=\; \frac{1}{2}(3 + 3) \;=\; \frac{1}{2}(6) \;=\; 3 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 3, \; 3 ) \;=\; \sqrt[2]{3 \times 3} \;=\; \sqrt[2]{9} \;=\; 3 $$

Example 5.2
The arithmetic mean is:
 * $$ \operatorname{AM} ( 1, \; 2, \; 3, \; 4, \; 5 ) \;=\; \frac{1}{5}(1 + 2 + 3 + 4 + 5) \;=\; \frac{1}{5}(15) \;=\; 3 $$

The geometric mean is:
 * $$ \operatorname{GM} ( 1, \; 2, \; 3, \; 4, \; 5 ) \;=\; \sqrt[5]{1 \times 2 \times 3 \times 4 \times 5} \;=\; \sqrt[5]{120} \;\approx\; 2.6052 $$

Conclusion
In both cases the arithmetic mean would be preferred over the geometric mean, because we are comparing equal values / values on the same scale to each other.

We also see that in ex 5.1 the arithmetic and geometric mean are equal.

Example 6
phoronix speed comparison before it was this case: higher values = better rating (e.g. a financial rating of 60/100 is better than one of 40/100) problem here: it is also possible that a lower values might indicate a better rating this might be the case with time, where a shorter time needed for a certain task indicates better performance. This is the case with a speed comparision in the Phoronix testsuite.


 * benchmark XY higher is better: e.g. Geekbench, see https://browser.geekbench.com/v5/cpu
 * don't use frametime / milliseconds !!
 * don't use frames per second?


 * less is better_OpenBenchmarking.org - Timed Linux Kernel Compilation Test Profile _ alternative for less is better: selenium maze solver
 * https://openbenchmarking.org/test/pts/build-linux-kernel
 * more is better Selenium StyleBench_ OpenBenchmarking.org - Selenium Test Profile
 * https://openbenchmarking.org/test/system/selenium
 * Compilation time performance

Michael Larabel's Phoronix.com benchmarks:
 * Phoronix.com: Apple macOS 10.15 vs. Windows 10 vs. Ubuntu 19.10 Performance Benchmarks
 * Phoronix.com: Windows 10 vs. Ubuntu 19.10 vs. Clear Linux vs. Debian 10.1 Benchmarks On An Intel Core i9
 * Phoronix.com: Firefox 70 Linux Performance, Firefox 70 vs. Chrome 78 Benchmarks
 * AMD Ryzen 9 3900X vs. Intel Core i9 9900K Performance In 400+ Benchmarks
 * Windows 10 vs. Linux OpenGL/Vulkan Driver Performance With Intel Icelake Iris Plus Graphics

Harmonic:
 * Phoronix.com: 117 Gaming Benchmarks With NVIDIA GTX 1660 Ti / RTX 2060 vs. AMD RX 590 / RX Vega 56

Example 6.1

 * 2 values
 * more is better: frames per second fps
 * less is better: benchmark 1

Example 6.2

 * 3 values
 * more is better: frames per second fps
 * more is better: benchmark value, a (lets say 25.000)
 * less is better benchmark 1

Example 6.3

 * 4 values
 * more is better: frames per second fps
 * more is better: benchmark value, a (lets say 25.000)
 * less is better: benchmark 1
 * less is better: benchmark 2

Conclusion
xyz