src/Statistics/Distribution.php
public static function cumulativeRelativeFrequency(array $values): array
    {
        $sample_size            = count($values);
        $cumulative_frequencies = self::cumulativeFrequency($values);
        return array_map(
            function ($frequency) use ($sample_size) {
                return $frequency / $sample_size;
            },
            $cumulative_frequencies
        );
    }
public static function cumulativeRelativeFrequency(array $values): array
    {
        $sample_size            = count($values);
        $cumulative_frequencies = self::cumulativeFrequency($values);
        return array_map(
            function ($frequency) use ($sample_size) {
                return $frequency / $sample_size;
            },
            $cumulative_frequencies
        );
    }
public static function cumulativeRelativeFrequency ( array $ values ) : array { $ sample_size = count ( $ values ) ; $ cumulative_frequencies = self :: cumulativeFrequency ( $ values ) ; return array_map ( function ( $ frequency ) use ( $ sample_size ) { return $ frequency / $ sample_size ; } , $ cumulative_frequencies ) ; }
Cumulative relative frequency distribution
Cumulative frequency distribution relative to the sample size.

Cumulative relative frequency = cumulative frequency / sample size

The values of the input array will be the keys of the result array.
The cumulative frequency of the values will be the value of the result array for that key.

@param array $values Ex: ( A, A, A, A, A, A, B, B, B, C )

@return array cumulative relative frequency distribution Ex: ( A => 0.6, B => 0.9, C => 1 )
Cumulative relative frequency distribution Cumulative frequency distribution relative to the sample size .