MathPHP\Statistics\Average::geometricMean PHP Method

geometricMean() public static method

https://en.wikipedia.org/wiki/Geometric_mean __________ Geometric mean = ⁿ√a₀a₁a₂ ⋯
public static geometricMean ( array $numbers ) : number
$numbers array
return number
    public static function geometricMean(array $numbers)
    {
        if (empty($numbers)) {
            return null;
        }
        $n = count($numbers);
        return pow(array_reduce($numbers, function ($carry, $a) {
            return !empty($carry) ? $carry * $a : $a;
        }), 1 / $n);
    }