Types of mean

From SubSurfWiki
Jump to: navigation, search

With Python code for an array-like a.

Types of mean
Mean Remarks NumPy function SciPy function
Arithmetic[1] the sum divided by the population size, n — used when the sum is of interest numpy.mean(a)
Geometric [1][2] the nth root of the product — used when the product is of interest scipy.stats.mstats.gmean(a)
Harmonic [1] n divided by the sum of the reciprocals — used for rates and ratios scipy.stats.mstats.hmean(a)
Quadratic or RMS the square root of the arithmetic mean of the squares — used for magnitudes np.sqrt(np.mean(a**2))
  1. 1.0 1.1 1.2 Pythagorean means, for which A ≥ G ≥ H
  2. Only defined for positive numbers

See also

External links