stats/cdf_utils library
Empirical CDF and cumulative histogram for numeric samples — roadmap #574.
Complements the bin-counting histogramFixed/histogramQuantile in
collections/histogram_utils.dart with the cumulative view: what fraction
of samples fall at or below a value. The cumulative histogram reuses
histogramFixed directly so the two stay consistent.
Classes
Functions
-
cdfAt(
List< num> values, num x) → double -
The empirical CDF of
valuesevaluated atx: the fraction of samples that are ≤x, in[0, 1]. Returns 0 for no samples. Audited: 2026-06-12 11:26 EDT -
cumulativeHistogram(
List< num> values, List<num> edges) → List<int> -
Cumulative histogram: the running total of
histogramFixed(values, edges), so biniholds the count of samples in bins0..i— the CDF in bin form. Returns an empty list whenedgeshas fewer than two entries. -
empiricalCdf(
List< num> values) → List<CdfPoint> -
Builds the empirical CDF of
values: one CdfPoint per DISTINCT value in ascending order, withpthe running fraction of samples ≤ that value. Returns an empty list for no samples. Does not mutatevalues.