Types of mean

From SubSurfWiki
Revision as of 14:18, 8 January 2014 by Matt (talk | contribs) (cat)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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