Calculate Log-Geometric Mean

Online calculator to compute the log-geometric mean of a data series

Log-Geometric Mean Calculator

The Log-Geometric Mean

The log-geometric mean is the arithmetic mean of the logarithms of the values. It equals the logarithm of the geometric mean: log(G).

Enter Data
Positive data values (separated by space or semicolon)
Result
Log-Geometric Mean:
Properties of the Log-Geometric Mean

Important: log(G) = (1/n)Σlog(xᵢ). Equals the logarithm of the geometric mean.

Logarithmic For Growth Rates Numerically Stable

Log-Geometric Mean Concept

The log-geometric mean is the arithmetic mean of the logarithms.
It is numerically more stable than the geometric mean.

Logarithms → Average 7 9 12 log 1.95 2.20 2.48 + + Sum 6.63 3 (n) 2.21

Input Values Logarithms Log-Geometric Mean


What is the Log-Geometric Mean?

The log-geometric mean is a logarithmic representation of the geometric mean:

  • Definition: Arithmetic mean of the logarithms
  • Calculation: log(G) = (1/n)Σlog(xᵢ)
  • Relationship: log(G) equals the logarithm of the geometric mean
  • Advantage: Numerically more stable for very large/small values
  • Application: Growth rates, probability theory
  • Conversion: G = exp(log(G)) = 10^(log(G))

Calculating the Log-Geometric Mean

The calculation follows four steps:

1. Logarithmize

Create logarithms:
log(x₁), log(x₂), ..., log(xₙ)

2. Sum

Add logarithms:
S = Σlog(xᵢ)

3. Count

Determine count:
n = Number of Values

4. Divide

Divide S by n:
log(G) = S / n

Applications of the Log-Geometric Mean

The log-geometric mean has applications in specialized areas:

Numerical Computation
  • Avoiding overflow with large numbers
  • Avoiding underflow with small numbers
  • More stable calculations than direct geometric mean
  • Important in machine learning and probability theory
Scientific Applications
  • Information theory: Entropy calculations
  • Statistics: Log-normal distributions
  • Biology: pH values, population growth
  • Finance: Continuous returns

Formulas for the Log-Geometric Mean

Log-Geometric Mean
\[\log(G) = \frac{1}{n} \sum_{i=1}^{n} \log(x_i)\]

Arithmetic mean of the logarithms

Extended Form
\[\log(G) = \frac{\log(x_1) + \log(x_2) + ... + \log(x_n)}{n}\]

Explicit representation

Relationship to Geometric Mean
\[G = \exp(\log(G)) = e^{\log(G)}\] \[G = 10^{\log_{10}(G)}\]

Conversion: Apply exponential function

Logarithm Rules
\[\log(x_1 \cdot x_2) = \log(x_1) + \log(x_2)\] \[\log(x^n) = n \cdot \log(x)\]

Important computational rules for logarithms

Symbol Explanations
\(\log(G)\) Log-Geometric Mean
\(G\) Geometric Mean
\(x_i\) Individual Data Value
\(n\) Number of Values
\(\log\) Logarithm (Base 10)
\(\ln\) Natural Logarithm

Example Calculations for the Log-Geometric Mean

Example 1: Basic Calculation
Data: 7, 9, 12

Calculate: Log-geometric mean of 3 values

1. Logarithmize
\[\log(7) \approx 1.95\] \[\log(9) \approx 2.20\] \[\log(12) \approx 2.48\]

Logarithm base 10

2. Sum & Divide
\[\sum = 1.95 + 2.20 + 2.48 = 6.63\] \[\log(G) = \frac{6.63}{3}\] \[= \color{blue}{2.21}\]

Average of logarithms

3. Geometric Mean
\[G = 10^{\log(G)}\] \[= 10^{2.21}\] \[\approx \color{blue}{162.18}\]

Optional: Convert back to G

Example 2: Numerical Stability with Large Numbers
Data: 10⁶, 10⁸, 10¹⁰

Problem: Direct product causes overflow

Direct Method (Problematic)
\[G = \sqrt[3]{10^6 \cdot 10^8 \cdot 10^{10}}\] \[= \sqrt[3]{10^{24}}\]

⚠️ Risk of overflow with very large numbers!

Log Method (Stable)
\[\log(G) = \frac{6 + 8 + 10}{3} = \frac{24}{3} = 8\] \[G = 10^8\]

✓ No overflow problems!

Important Advantage

The log-geometric mean works with additions instead of multiplications. This prevents overflow with very large numbers and underflow with very small numbers. In practice, calculations are often done with logarithms and transformed back only at the end.

Example 3: Growth Rates Over Multiple Periods
Growth Factors: 1.1, 1.2, 1.05, 1.15

Calculate average growth factor

Log Method
\[\log(G) = \frac{\log(1.1)+\log(1.2)+\log(1.05)+\log(1.15)}{4}\] \[= \frac{0.0414+0.0792+0.0212+0.0607}{4}\] \[= \frac{0.2025}{4} \approx 0.0506\]
Result
\[G = 10^{0.0506} \approx 1.123\]

Average Growth:
12.3% per period

Interpretation

The geometric mean (calculated via logarithms) gives the average multiplicative growth. With growth factors of 1.1, 1.2, 1.05, and 1.15, the average growth is 12.3% per period. This is the correct method for growth rates over multiple periods!

Mathematical Foundations of the Log-Geometric Mean

The log-geometric mean is a logarithmic representation of the geometric mean with important practical advantages in numerical computations.

Properties of the Log-Geometric Mean

The log-geometric mean has characteristic mathematical properties:

  • Equivalence: log(G) = (1/n)Σlog(xᵢ) corresponds to G = ⁿ√(Πxᵢ)
  • Linearity: Adds logarithms instead of multiplying
  • Numerical Stability: Prevents overflow/underflow
  • Logarithm Rules: log(a·b) = log(a) + log(b)
  • Base Independence: Works with ln, log₁₀, or log₂

Why Use Logarithms?

Advantages
  • Numerical Stability: No overflow problems with large numbers
  • No Underflow: No precision loss with small numbers
  • Simpler Arithmetic: Addition instead of multiplication
  • Better Conditioning: More stable with extreme values
  • Efficiency: Faster computation
Practical Applications
  • Machine Learning: Log-likelihood functions
  • Statistics: Log-normal distributions
  • Information Theory: Entropy calculations
  • Finance: Continuous returns
  • Biology: pH values, population dynamics

Relationship to Other Concepts

Log-Normal Distribution

If X is log-normally distributed, then log(X) is normally distributed. The log-geometric mean is the expected value of log(X): E[log(X)] = log(G)

Continuous Returns

In finance, the log-geometric mean of growth factors corresponds to the average continuous return: r = log(G)

Entropy

In information theory, entropy is closely related to the log-geometric mean. Average information corresponds to the negative log-geometric mean of probabilities.

Choosing a Logarithm Base

Natural Logarithm

ln(x) = log_e(x)
Base e ≈ 2.718
For continuous processes

Common Logarithm

log₁₀(x) = log(x)
Base 10
For pH values, decibels

Binary Logarithm

log₂(x) = lb(x)
Base 2
For computer science, bits

Practical Example: Machine Learning

Log-Likelihood

In machine learning, probabilities are often multiplied: P = p₁ · p₂ · ... · pₙ

Problem: With many small probabilities (e.g., 0.01), P becomes extremely small → underflow

Solution: Use log-likelihood: log(P) = log(p₁) + log(p₂) + ... + log(pₙ)
This corresponds to the log-geometric mean multiplied by n.

Summary

The log-geometric mean is a practical and numerically stable alternative to the direct geometric mean. It transforms multiplications into additions, preventing overflow and underflow problems with extreme values. The method is indispensable in numerical mathematics, especially in machine learning (log-likelihood), finance (continuous returns), and information theory (entropy). The choice of logarithm base (ln, log₁₀, log₂) depends on the application context but does not change the principle.

Ist diese Seite hilfreich?            
Vielen Dank für Ihr Feedback!

Das tut uns leid

Wie können wir die Seite verbessern?