x <- 1:3
w <- c(0.25, 0.25, 0.5)
# The dispersion between the arithmetic, geometric, and harmonic
# mean usually increases as the variance of 'x' increases.
x <- c(1, 3, 5)
y <- c(2, 3, 4)
var(x) > var(y)
arithmetic_mean(x) - geometric_mean(x)
arithmetic_mean(y) - geometric_mean(y)
geometric_mean(x) - harmonic_mean(x)
geometric_mean(y) - harmonic_mean(y)
# But the dispersion between these means is only bounded by the
# variance (Bullen, 2003, p. 156).
arithmetic_mean(x) - geometric_mean(x) >= 2 / 3 * var(x) / (2 * max(x))
arithmetic_mean(x) - geometric_mean(x) <= 2 / 3 * var(x) / (2 * min(x))
# Example by Lord (2002) where the dispersion decreases as the variance
# increases, counter to the claims by Fisher (1922, p. 108) and the
# CPI manual (par. 1.14)
x <- (5 + c(sqrt(5), -sqrt(5), -3)) / 4
y <- (16 + c(7 * sqrt(2), -7 * sqrt(2), 0)) / 16
var(x) > var(y)
arithmetic_mean(x) - geometric_mean(x)
arithmetic_mean(y) - geometric_mean(y)
geometric_mean(x) - harmonic_mean(x)
geometric_mean(y) - harmonic_mean(y)
# The "bias" in the arithmetic and harmonic indexes is also smaller in
# this case, counter to the claim by Fisher (1922, p. 108)
arithmetic_mean(x) * arithmetic_mean(1 / x) - 1
arithmetic_mean(y) * arithmetic_mean(1 / y) - 1
harmonic_mean(x) * harmonic_mean(1 / x) - 1
harmonic_mean(y) * harmonic_mean(1 / y) - 1
Run the code above in your browser using DataLab