arrGeometricMean method

num arrGeometricMean(
  1. List<num> numbers
)

In mathematics, the geometric mean is a mean or average, which indicates the central tendency or typical value of a set of numbers by using the product of their values (as opposed to the arithmetic mean which uses their sum). The geometric mean is defined as the nth root of the product of n numbers, i.e., for a set of numbers x1, x2, ..., xn.

👉 Source

Example

print(Statistical().arrGeometricMean([1, 2, 3, 4, 5, 6, 7]));
//output 3.380015159141296

Implementation

num arrGeometricMean(List<num> numbers) => pow(
    numbers.reduce((accumulator, current) => accumulator * current),
    1 / numbers.length);