(values, p, valueof = number$3)
| 980 | } |
| 981 | |
| 982 | function quantileIndex(values, p, valueof = number$3) { |
| 983 | if (isNaN(p = +p)) return; |
| 984 | numbers = Float64Array.from(values, (_, i) => number$3(valueof(values[i], i, values))); |
| 985 | if (p <= 0) return minIndex(numbers); |
| 986 | if (p >= 1) return maxIndex(numbers); |
| 987 | var numbers, |
| 988 | index = Uint32Array.from(values, (_, i) => i), |
| 989 | j = numbers.length - 1, |
| 990 | i = Math.floor(j * p); |
| 991 | quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j])); |
| 992 | i = greatest(index.subarray(0, i + 1), (i) => numbers[i]); |
| 993 | return i >= 0 ? i : -1; |
| 994 | } |
| 995 | |
| 996 | function thresholdFreedmanDiaconis(values, min, max) { |
| 997 | const c = count$1(values), d = quantile$1(values, 0.75) - quantile$1(values, 0.25); |
no test coverage detected