cdfAt function
The empirical CDF of values evaluated at x: the fraction of samples that
are ≤ x, in [0, 1]. Returns 0 for no samples.
Audited: 2026-06-12 11:26 EDT
Implementation
double cdfAt(List<num> values, num x) {
if (values.isEmpty) return 0;
int count = 0;
for (final num v in values) {
if (v <= x) count++;
}
return count / values.length;
}