The geometric mean defined as

$$\text{Geometric mean}=\sqrt[n]{x_1\cdot x_2\cdots x_n}$$

is only defined for a positive inner product. A description and clarifications are in this question. Having negative numbers in a dataset can thus make it very difficult to use. I still prefer the geometric mean over the arithmetic mean due to its better resilience against far-outliers (at least when the dataset is not large enough for a trustworthy median to be used instead.)

A work-around to get rid of the no-negative-numbers issue, could be to add a large enough number before performing the geometric-mean operation and afterwards subtracting that same number from the result:

$$\text{Geometric mean}_\text{work-around}=\sqrt[n]{(10000+x_1)\cdot (10000+x_2)\cdots (10000+x_n)}-10000$$

This moves all data values "out off" the negative zone, performs the operation and then moves the result "back down" again.

I do see minor differences, though, when I compare the geometric mean with and without the workaround on only-positive numbers.

Since I cannot clearly figure out, how big the influence is, I am asking here to have it clarified. Is this workaround useful / correct to use, and can I trust my resulting mean datapoints?

More specifically, I do not clearly see why the true geometric mean and my work-around geometric mean are different, so my I am asking how different they are and how/why they are different.

  • $\begingroup$ I don't understand what you mean by asking how big the influence is. Are you looking for the difference in the values of the actual GM and your work-around GM? Are you looking for an approximation for that quantity based on the large number we have added to our data set? Is that what you want? $\endgroup$ – stressed out Nov 30 '17 at 10:30
  • $\begingroup$ Thank you for the comment, @stressed-out. I believe I am asking for the former; that there is a difference between the actual GM and the work-around GM is not clear for me. How big this difference will be, and how/why it appears, is what I would like clarification about. At the moment I am not sure how deviating my work-around is so I can't decide how useful it is in my situation. $\endgroup$ – Steeven Nov 30 '17 at 10:54
  • $\begingroup$ How big the difference is, when both are defined, is clear actually. Even though it's messy and not very pleasant looking, but it is given by $\left| (\sqrt[n]{(a+x_1)\cdot (a+x_2) \cdots (a+x_n)}-a)-\sqrt[n]{(x_1)\cdot (x_2) \cdots (x_n)} \right|$ for when we're dealing with good old positive numbers and just shift them by a big $a$. So, maybe your question is about how to find upper and lower bounds for that expression? or some less ugly-looking expression that works as an approximation? $\endgroup$ – stressed out Nov 30 '17 at 10:59
  • $\begingroup$ Depending on the size of your dataset, if you are concerned about sensitivity to outliers, is it not an option to use the median, the mode or the inter-quartile mean? All of these are robust vs outliers and would save you from trying to hack the geometric mean. $\endgroup$ – CBowman Nov 30 '17 at 11:04
  • $\begingroup$ @stressed-out Yes, I believe that is my question. $\endgroup$ – Steeven Nov 30 '17 at 11:40

If we let your large number be $k$, we could also write your definition as

$$ k\left(\prod_n \left(1 + \frac{x_n}{k}\right)\right)^{\frac{1}{n}} - k = k\exp{\left(\frac{1}{n}\sum_n \log{\left(1 + \frac{x_n}{k}\right)}\right)} - k $$ Now replace the log with its Taylor series: $$ k\exp{\left(\frac{1}{n}\sum_n \log{\left(1 + \frac{x_n}{k}\right)}\right)} - k = k\exp{\left(\frac{1}{n}\sum_n \left(\sum_{m=1}^{\infty} \frac{(-1)^{m+1}}{m} \left(\frac{x_n}{k}\right)^{m}\right)\right)} - k $$ $$ = k\exp{\left( \sum_{m=1}^{\infty} \frac{(-1)^{m+1}}{m k^m} \left(\frac{1}{n}\sum_nx_n^m \right)\right)} - k $$ If the $\frac{x_n}{k}$ are small, which given the description of $k$ being 'large' may be reasonable, we can truncate the series to first order giving $$ = k\exp{\left( \frac{1}{nk}\sum_nx_n \right)} - k = k\exp{\left( \frac{1}{n}\sum_nx_n \right)}^{\frac{1}{k}} - k $$ So in the limit where $k$ is much larger than your data values, your modified geometric mean is really a function of the exponentiation of the arithmetic mean... I can't really see this being a good estimator sadly. Or at least, it doesn't make intuitive to sense me, perhaps someone else has more insight.


In fact, it is also true that $$ \lim_{k\to\infty} k \exp{\left(\frac{x}{k}\right)} - k = x, $$ so rather interestingly we find that for very large $k$, your modified geometric mean is just the arithmetic mean: $$ \lim_{k\to\infty} \; \left[ k\left(\prod_n \left(1 + \frac{x_n}{k}\right)\right)^{\frac{1}{n}} - k \right]= \frac{1}{n}\sum_n x_n . $$ Additionally we know that the minimum value of $k$ you could choose yields an answer of zero. I suspect (seen in numerical testing, but not sure how to prove it) that the result increases monotonically between zero and the arithmetic mean as you increase $k$.

If true, this isn't really good news for your estimator... it would mean you can never get a value larger than the arithmetic mean (obviously a big problem if an outlier is below the mean) and to me at least, this suggests it has no value.

Although in fairness this is true for the normal geometric mean anyway, via the AM-GM inequality.

  • $\begingroup$ Thank you for the answer, CBowman. So, a very large $k$ compared to the data values is apparently skewing the data? This is good to know - Now, let's say that $k$ is not very much larger but only, say, a factor of 10 larger. Or less. It would be easy to search a dataset for the smallest value and use exactly that value as $k$ (or a bit larger, so we don't have 0's). Would this be a more fitting modification giving a better (a "more true") picture of the data? $\endgroup$ – Steeven Nov 30 '17 at 13:51
  • $\begingroup$ @Steeven Yes I suppose the point is that because for very large $k$ the answer is purely a function of the arithmetic mean and $k$, it doesn't avoid the sensitivity to outliers at all, so in that limit it'd be better to just use the arithmetic mean itself. As for the opposite case where you make $k$ as small as possible, as you say you'll have some values near zero, and I suspect that will significantly skew the answer as well. $\endgroup$ – CBowman Dec 3 '17 at 19:00
  • $\begingroup$ @steeven Ideally you want the answer to be as insensitive to the choice of $k$ as possible... it could be interesting to find the value of $k$ which minimises $\partial \mu / \partial k$ and use that as the value - that is at least a less arbitrary way of selecting the value. $\endgroup$ – CBowman Dec 3 '17 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.