for returns list R: gm_return = math.exp(sum(math.log(1+r) for r in R)/len(R)) – 1

Definition · Updated October 13, 2025

Key takeaways

– The geometric mean (GM) is the nth root of the product of n positive numbers; for returns it is typically expressed as the compounded average rate of return.
– Use the geometric mean for multiplicative processes (growth rates, returns, ratios) because it accounts for compounding; the arithmetic mean should be used for additive processes.
– GM is always ≤ arithmetic mean; it cannot be computed if any term is negative (for real-valued GM) and is zero if any term is zero.
– For series of returns R1…Rn, GM = [(1+R1)(1+R2)…(1+Rn)]^(1/n) − 1. For numerical stability use logs: GM = exp((1/n) Σ ln(xi)).

Understanding the geometric mean

The geometric mean is a measure of central tendency appropriate for numbers that combine multiplicatively. In investing, it represents the average compounded growth rate over time — sometimes called the compounded annual growth rate (CAGR) when the periods are years. Unlike the arithmetic mean, which adds values and divides by n, the geometric mean multiplies the values and takes the nth root, so it captures the effect of compounding and volatility.

When to use the geometric mean

– Time series of returns (portfolio performance, CAGR)
– Growth factors (population growth, interest compounding)
– Ratios or indices where values multiply over periods
Do not use GM when values are additive (e.g., average monthly balances where sums matter) or when data include nonpositive numbers (unless you convert them appropriately).

Formula(s)

– For n positive numbers x1, x2, …, xn:
GM = (x1 · x2 · … · xn)^(1/n)
– For periodic returns R1, R2, …, Rn (expressed as decimals):
GMreturns = [(1 + R1)(1 + R2)…(1 + Rn)]^(1/n) − 1
– Log form (numerically stable; works well in code and spreadsheets):
GM = exp[(1/n) · Σ ln(xi)]
For returns: GMreturns = exp[(1/n) · Σ ln(1 + Ri)] − 1
– Weighted geometric mean (weights wi, Σwi = 1):
GMweighted = Π xi^{wi} = exp[Σ wi · ln(xi)]

Calculating geometric mean — step-by-step example

Example: five annual returns: 5%, 3%, 6%, 2%, 4% (i.e., R = 0.05, 0.03, 0.06, 0.02, 0.04)

1. Convert returns to growth factors: 1 + Ri = 1.05, 1.03, 1.06, 1.02, 1.04.

2. Multiply the factors:
Product = 1.05 × 1.03 × 1.06 × 1.02 × 1.04 ≈ 1.214030712
3. Take the nth root (n = 5): (Product)^(1/5) ≈ 1.03958
4. Subtract 1 and convert to percent: GM ≈ 1.03958 − 1 = 0.03958 ≈ 3.96% (rounded ≈ 3.99%)

Compare with arithmetic mean: (5%+3%+6%+2%+4%)/5 = 4.0% — geometric mean is slightly lower because it accounts for compounding and variability.

Practical numerical method (logs) — better for many or large numbers

1. Compute ln(1 + Ri) for each return.
2. Take the average of those logs.
3. Exponentiate and subtract 1:
GMreturns = exp[average(ln(1 + Ri))] − 1
This avoids overflow/underflow and loss of precision when multiplying many numbers.

Calculate the geometric mean in spreadsheets and code

– Excel:
– If you have growth factors in A1:A5: =GEOMEAN(A1:A5)
– If you have returns in B1:B5 (e.g., 0.05): =GEOMEAN(1+B1:B5)-1 (entered as an array or use helper column)
– Log method: =EXP(AVERAGE(LN(1+B1:B5))) – 1
– Google Sheets: same functions (GEOMEAN, LN, EXP, AVERAGE) work similarly.
– Python example:
import math
data = [1.05, 1.03, 1.06, 1.02, 1.04]
gm = math.exp(sum(math.log(x) for x in data) / len(data))
# for returns list R: gm_return = math.exp(sum(math.log(1+r) for r in R)/len(R)) – 1

Important notes, edge cases, and handling negative/zero values

– Zeros: If any xi = 0, the geometric mean is 0 (product becomes zero).
– Negatives: The geometric mean (as commonly used for real-valued positive data) cannot include negative numbers because logs are undefined and nth roots of negative products may be complex. For returns, negative percentages are handled by converting to growth factors 1 + R (e.g., −3% → 0.97). Only if some 1+R are negative (which means a return less than −100%) does the GM become undefined in real terms.
– If raw data include both positive and negative numbers not representing returns, GM is not appropriate. Some advanced techniques exist (e.g., sign-preserving transformations) but are nonstandard for GM and may be misleading.
– Weighted GM: Use xi^{wi} and ensure weights sum to 1 (useful when observations represent different time lengths or weights).

How to find the geometric mean between two numbers

– For two positive numbers a and b:
GM = sqrt(a × b)
Example: numbers 2 and 8 → GM = sqrt(2 × 8) = sqrt(16) = 4.

What is the geometric mean of n terms?

– For n positive terms x1 … xn:
GM = (x1 · x2 · … · xn)^(1/n)
This is the product raised to the power 1/n (the nth root of the product).

When to use arithmetic mean vs geometric mean

– Use geometric mean for multiplicative processes (growth rates, returns, percent changes).
– Use arithmetic mean for additive quantities (sums, averages of independent samples for expected value).
– The geometric mean will generally be lower than the arithmetic mean unless all values are equal.

Practical checklist (how to compute GM for a series of returns)

1. Gather period returns R1…Rn (as decimals, e.g., 0.05).
2. Convert to growth factors: Gi = 1 + Ri.
3. Confirm all Gi > 0 (if any Gi ≤ 0, GM is undefined or zero).
4. Compute GM by either:
– Direct multiplicative route: (Π Gi)^(1/n) − 1
– Log route: exp[(1/n) Σ ln(Gi)] − 1 (preferred for many values)
5. Convert to percentage and interpret as the average compounded rate per period.

Limitations and caveats

– Sensitive to zeros and nonpositive values.
– Requires consistent period lengths (annual returns vs monthly returns must be handled differently — convert to same period).
– For comparing investments with different cash flows/weights, consider time-weighted or money-weighted returns rather than a simple GM of period returns.

The bottom line

The geometric mean is the appropriate “average” when you care about multiplicative growth or compounded returns. It properly accounts for compounding and volatility and is commonly used by portfolio managers and analysts to report average growth rates over time. Use logs for numerical stability, convert returns to growth factors (1+R), and remember that the GM applies to positive values only.

Sources

– Investopedia, “Geometric Mean,” Michela Buttignol (Investopedia). URL: https://www.investopedia.com/terms/g/geometricmean.asp
– Envestnet PMC, “Arithmetic, Geometric and Other Types of Averages.”

Continuing from the previous text, below is an expanded, practical, and sourced guide to the geometric mean with additional sections, examples, and a concluding summary.

What the Geometric Mean Measures

– The geometric mean (GM) measures the central tendency of a set of multiplicative factors. In finance, this usually means average compound growth per period — e.g., the average annual return accounting for compounding.
– It differs from the arithmetic mean because it multiplies factors and takes an nth root (or equivalently averages logs), so it correctly reflects compounding effects over time. Because of that, the GM is always ≤ the arithmetic mean for non-constant positive values.

Quick formulas (two common forms)

– For positive numbers x1, x2, …, xn:
GM = (x1 × x2 × … × xn)^(1/n)
– For returns R1, R2, …, Rn expressed as percentages:
GM = [(1+R1) × (1+R2) × … × (1+Rn)]^(1/n) − 1
– Log form (numerically stable and practical for many values):
GM = exp[(1/n) × Σ ln(xi)]

Step-by-step practical procedure (for investment returns)

1. Convert each period return Ri into a growth factor fi = 1 + Ri (e.g., +5% → 1.05; −3% → 0.97).
2. Multiply all growth factors: P = ∏ fi.
3. Take the nth root of P: root = P^(1/n). Using logs: root = exp[(1/n) × Σ ln(fi)].
4. Subtract 1 to convert back to a percentage: GM = root − 1.
5. Interpret GM as the average compound growth per period.

Worked examples

A. Five-year return example (practical)

Suppose annual returns are: 5%, 3%, 6%, 2%, 4%.
– Convert to factors: 1.05, 1.03, 1.06, 1.02, 1.04.
– Product P = 1.05 × 1.03 × 1.06 × 1.02 × 1.04 ≈ 1.21403.
– 5th root: P^(1/5) ≈ 1.0394.
– GM = 1.0394 − 1 ≈ 0.0394 = 3.94% per year (rounded).
Note: the arithmetic mean of these five numbers is 4.0% (slightly higher because arithmetic mean ignores compounding).

B. Two-number example

– Numbers: 2 and 8.
– GM = (2 × 8)^(1/2) = (16)^(1/2) = 4.

C. Negative-return example (how to include negatives)

– If an annual return is −3%, use factor 0.97 (1 − 0.03).
– Example returns: +10%, −3%, +5% → factors 1.10, 0.97, 1.05.
– GM = (1.10 × 0.97 × 1.05)^(1/3) − 1 ≈ [1.11915]^(1/3) − 1 ≈ 0.0378 = 3.78% per year.
Caveat: you cannot include raw negative numbers directly as inputs to the standard GM formula (multiplying negative values can produce negatives and complex roots). Always convert returns to positive growth factors (1+R). If any factor equals zero, the GM is zero.

D. CAGR (special case of geometric mean)

– Compound Annual Growth Rate over n years from beginning value B to ending value E:
CAGR = (E / B)^(1/n) − 1
– Example: B = $100, E = $150, n = 4 → CAGR = (1.5)^(1/4) − 1 ≈ 0.1067 = 10.67% per year.

Weighted geometric mean

– When observations have weights wi (that sum to 1), the weighted geometric mean is:
GM_weighted = ∏ xi^(wi) = exp[Σ wi × ln(xi)]
– Example: factors 1.10 and 1.05 with weights 0.7 and 0.3:
GM = 1.10^0.7 × 1.05^0.3 ≈ exp(0.7 ln 1.10 + 0.3 ln 1.05) − 1 (if used for returns, subtract 1).

Calculating geometric mean in spreadsheets

– Excel: GEOMEAN(range) returns the geometric mean of positive numbers in the range. If you have returns in percent (e.g., −3% as −0.03), first convert to factors in an adjacent column: =1 + cell; then use GEOMEAN on the factor range and subtract 1 for a percent return:
=GEOMEAN(A1:A5) − 1 (where A1:A5 contain 1+Ri).
– Google Sheets: GEOMEAN(range) works the same way.
– For CAGR: use =POWER(Ending/Beginning,1/Periods) − 1.

Numerical tips and stability

– For many values or very large/small products, compute the mean of logs and exponentiate:
GM = EXP(AVERAGE(LN(values)))
This avoids overflow/underflow and is numerically stable.
– LN requires strictly positive inputs.

When geometric mean is not appropriate

– Data that are additive (e.g., temperatures in degrees, raw counts) — use arithmetic mean.
– Data sets containing zero or negative values (unless you transform to positive multiplicative factors like 1+R).
– When you need to sum or average absolute changes rather than multiplicative rates.

Practical use cases in finance and beyond

– Finance: average compounded returns, portfolio performance (time-weighted returns), long-term growth rates.
Business: average growth of revenues, CPI/growth indices, performance ratios.
– Science: averaging multiplicative biological measures (e.g., fold changes), index construction.

Limitations and cautions

– Sensitive to zeros — a single zero factor makes the whole geometric mean zero.
– Cannot directly accept negative raw inputs.
– Tends to be lower than arithmetic mean; the difference reflects volatility — greater variability in returns lowers the geometric mean relative to the arithmetic mean.
– Provides a single summary number; does not describe volatility or the distribution of returns.

Additional practical examples

1. Mixed returns including a loss that makes a negative ending value

– If a factor would be negative (e.g., a nominal asset value goes negative), the geometric mean is not meaningful without a different transformation or model. In finance, negative portfolio values are rare in properly scaled returns — use money-weighted returns or other measures if cash flows and negative balances are involved.

2. Portfolio example using weights across assets (time-invariant)

– If you want a weighted geometric mean of asset growths across assets with weights summing to 1, use the weighted formula above. For portfolio returns over time, you typically compute period-by-period portfolio returns (based on weights and asset returns) and then calculate the geometric mean across time.

Summary and best-practice checklist

– Use geometric mean when you need an average multiplicative rate (compounded growth).
– Always convert returns to factors (1+R) and ensure factors are positive.
– For many observations or when worried about numerical issues, compute the average of natural logs and exponentiate.
– In spreadsheets, prefer GEOMEAN on factors or use EXP(AVERAGE(LN(range))).
– Remember: GM ≤ arithmetic mean; the gap reflects the dispersion of the underlying returns.
– For single-period-to-single-period growth over multiple periods where you only know beginning and ending values, use CAGR = (Ending/Beginning)^(1/n) − 1 — an instance of the geometric mean.

Sources

– Investopedia, “Geometric Mean.” (https://www.investopedia.com/terms/g/geometricmean.asp)
– Envestnet PMC, “Arithmetic, Geometric and Other Types of Averages.”

Concluding remarks

The geometric mean is a fundamental tool when averaging rates, ratios, or multiplicative factors — particularly in finance to measure compounded returns. It produces the “true” per-period growth rate over a sequence of variable returns, preserves compounding dynamics, and is straightforward to compute with either direct multiplication or a log-based approach for stability. Use it where compounding matters, take care with zeros/negatives, and complement it with volatility and distributional measures when making decisions.

[[END]]

Related Terms

Further Reading