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);
    }
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);
    }
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 ) ; }
Compute the skewness of a set of values given a mean and n degrees of
freedom.

@param array $values
@param float|null $mean
@param int|null $n
@throws \InvalidArgumentException
@return float
Compute the skewness of a set of values given a mean and n degrees of freedom .