GeometricMean
GeometricMean[data]
gives the geometric mean of the values in data.
Details
- For VectorQ data {x1,x2,…,xn}, the geometric mean is given by .
- GeometricMean[{{x1,y1,…},{x2,y2,…},…}] gives {GeometricMean[{x1,x2,…}],GeometricMean[{y1,y2,…}]}. »
- For ArrayQ data, the geometric mean estimate is equivalent to ArrayReduce[GeometricMean,data,1]. »
- GeometricMean handles both numerical and symbolic data.
- The data can have the following additional forms and interpretations:
-
Association the values (the keys are ignored) » SparseArray as an array, equivalent to Normal[data] » QuantityArray quantities as an array » WeightedData weighted mean, based on the underlying EmpiricalDistribution » EventData based on the underlying SurvivalDistribution » TimeSeries, TemporalData, … vector or array of values (the time stamps ignored) » Image,Image3D RGB channel's values or grayscale intensity value » Audio amplitude values of all channels »
Examples
open allclose allScope (13)
Basic Uses (6)
Exact input yields exact output:
Approximate input yields approximate output:
Find the geometric mean of WeightedData:
Find the geometric mean of EventData:
Find the geometric mean of a TimeSeries:
The geometric mean depends only on the values:
Array Data (5)
GeometricMean for a matrix gives columnwise means:
Mean for a tensor works across the first index: »
When the input is an Association, GeometricMean works on its values:
SparseArray data can be used just like dense arrays:
Find the geometric mean of a QuantityArray:
Image and Audio Data (2)
Channelwise geometric mean value of an RGB image:
Geometric mean intensity value of a grayscale image:
On audio objects, GeometricMean works channelwise:
Properties & Relations (3)
GeometricMean is logarithmically related to Mean for positive values:
GeometricMean is logarithmically related to HarmonicMean for positive values:
For positive data, HarmonicMean[d]≤GeometricMean[d]≤Mean[d]:
Possible Issues (1)
GeometricMean may return complex values when data contains negative values:
For different sample realizations, the geometric mean is real:
Text
Wolfram Research (2007), GeometricMean, Wolfram Language function, https://reference.wolfram.com/language/ref/GeometricMean.html (updated 2023).
CMS
Wolfram Language. 2007. "GeometricMean." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/GeometricMean.html.
APA
Wolfram Language. (2007). GeometricMean. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GeometricMean.html