frequencyTable
Builds a frequency table by dividing the values into a fixed number of equal-width bins.
Each bin includes its count, relative frequency (proportion of total), and cumulative frequency (running proportion). The cumulative frequency of the last bin is always 1.0.
Example:
val freq = listOf(1.0, 2.0, 3.0, 4.0, 5.0).frequencyTable(2)
freq[0].relativeFrequency // proportion of values in the first bin
freq.last().cumulativeFrequency // 1.0Return
a list of FrequencyBin objects ordered by range. Returns an empty list if the collection is empty.
Parameters
the desired number of bins. Must be positive.
Builds a frequency table by dividing the values into equal-width bins of the given size.
Each bin includes its count, relative frequency (proportion of total), and cumulative frequency (running proportion). The cumulative frequency of the last bin is always 1.0.
Example:
val freq = listOf(1.0, 2.0, 3.0, 4.0, 5.0).frequencyTable(2.5)
freq[0].count // number of values in [1.0, 3.5]
freq.last().cumulativeFrequency // 1.0Return
a list of FrequencyBin objects ordered by range. Returns an empty list if the collection is empty.
Parameters
the width of each bin. Must be positive.
Builds a frequency table by dividing the values into a fixed number of equal-width bins.
This is a convenience overload that accepts a DoubleArray. The array is converted to a list internally.
Return
a list of FrequencyBin objects ordered by range. Returns an empty list if the array is empty.
Parameters
the desired number of bins. Must be positive.
See also
Builds a frequency table by dividing the values into equal-width bins of the given size.
This is a convenience overload that accepts a DoubleArray. The array is converted to a list internally.
Return
a list of FrequencyBin objects ordered by range. Returns an empty list if the array is empty.
Parameters
the width of each bin. Must be positive.