GEOMEANZ Function

Returns the geometric mean, using zero fuzzing.

Category: Descriptive Statistics
Returned data type: DOUBLE

Syntax

GEOMEANZ(expression [, ...expression])

Arguments

expression

specifies any valid expression that evaluates to a nonnegative numeric value.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

Details

If any argument is negative, then the result is a null or missing value. A message appears in the log that the negative argument is invalid. If any argument is zero, then the geometric mean is zero. If all the arguments are null or missing values, then the result is a null or missing value. Otherwise, the result is the geometric mean of the non-null or nonmissing values.
Let n  be the number of arguments with non-null or nonmissing values, and let x sub 1 , comma , x sub 2 , comma dot dot dot comma , x sub n  be the values of those arguments. The geometric mean is the n super t h end super  root of the product of the values:
table with 1 row and 1 column , row1 column 1 , index n root of open x sub 1 , times , x sub 2 , times dot dot dot times , x sub n . close end root , , end table
Equivalently, the geometric mean is shown in this equation.
table with 1 row and 1 column , row1 column 1 , exp of . open . fraction open log of . open , x sub 1 , close . plus log of . open , x sub 2 , close . plus dot dot dot plus log of . open , x sub n , close close , over n end fraction . close , end table

Comparisons

The MEAN function returns the arithmetic mean (average), and the HARMEAN function returns the harmonic mean, whereas the GEOMEANZ function returns the geometric mean of the non-null or nonmissing values. Unlike GEOMEAN, GEOMEANZ does not fuzz the values of the arguments that are approximately zero.

Example

The following statements illustrate the GEOMEANZ function:
Statements
Results
select geomeanz(1,2,2,4);
2
select geomeanz(.,2,4,8);
4