public static function skewness(array $values, ?float $mean = null, ?int $n = null) : float
    {
        $n = $n ?? count($values);

        if ($n === 0) {
            throw new InvalidArgumentException('Skewness is undefined for'
                . ' empty set.');
        }

        $mean = $mean ?? self::mean($values, $n);

        $numerator = self::centralMoment($values, 3, $mean);
        $denominator = self::centralMoment($values, 2, $mean) ** 1.5;

        return $numerator / ($denominator ?: EPSILON);
    }