In two previous posts, we discussed the L’Hôpital Rule:

https://irthoughts.wordpress.com/2012/05/22/understanding-the-lhopital-rule/

https://irthoughts.wordpress.com/2012/01/23/lhopitals-rule-and-the-00-power-controversy/

This time we show how to use the L’Hôpital Rule to derive the geometric mean from the power mean.

Deriving the Geometric Mean

The power mean from a set of n numbers of x values is defined as

Power mean = [(sum of x^p)/n]^1/p

where p is any real number.

Taking natural logs,

ln(Power mean) = [ln(sum of x^p) – ln(n)]/p

With respect to p, the right side of this expression is of the form

f(p)/g(p)

where

f(p) = ln(sum of x^p) – ln(n)

g(p) = p

So, for p = 0,

f(p)/g(p) = 0/0

This indeterminate form asks for applying the L’Hôpital Rule, which reduces to evaluating

f(p)/g(p) = f’(p)/g’(p) in the limit where p vanishes (approaches zero).

Proceeding with the derivation,

f’(p) = (1/sum of x^p) [sum of (x^p)ln(x)]

g’(p) = 1

f’(p)/g’(p) = (1/sum of x^p) [sum of (x^p)ln(x)]

Now when p = 0,

f’(p)/g’(p) = (1/n) [sum of ln(x)]

However, since

sum of ln(x) = ln(product of x)

then

f’(p)/g’(p) = (1/n) [ln(product of x)] = ln(product of x)^1/n

Therefore, taking the antilog, we obtain the geometric mean,

Geometric mean = (product of x)^1/n

Limitations of the geometric mean

Evidently, to compute the geometric mean from n numbers of x values these must be positive, greater than zero, and not written as percentages.

In the next section, we describe workarounds for circumventing these limitations.

Circumventing the limitations of the geometric mean

For a dataset with a zero value, we may add a positive value, k, calculate the geometric mean and substract k to the result. We may use a similar approach for a dataset with a negative, but insuring that k is greater than the largest negative value of the set.

For example, to calculate the geometric mean of the values +12%, -8%, and +2%, we may add 1 to remove the negative value and calculate the geometric mean of their decimal multiplier equivalents of 1.12, 0.92, and 1.02, to compute a geometric mean of 1.0167. Subtracting 1 from this value gives the geometric mean of +1.67%.

Note that for a dataset consisting of percents, we divide each percent by 100, compute the geometric mean, and multiply the result by 100.

Additional workarounds are found in:

http://www.buzzardsbay.org/geomean.htm

http://www.waterboards.ca.gov/water_issues/programs/swamp/docs/cwt/guidance/3413.pdf

Have a mean day!

PS. Sorry. I fixed the last section to add an example describing the workaround.