static double[] getPMFOrCDF(final DoublesSketch sketch, final double[] splitPoints, final boolean isCDF) { final double[] buckets = internalBuildHistogram(sketch, splitPoints); final long n = sketch.getN(); if (isCDF) { double subtotal = 0; for (int j = 0; j < buckets.length; j++) { subtotal += buckets[j]; buckets[j] = subtotal / n; //normalize by n } } else { // PMF for (int j = 0; j < buckets.length; j++) { buckets[j] /= n; //normalize by n } } return buckets; }
static double[] getPMFOrCDF(final DoublesSketch sketch, final double[] splitPoints, final boolean isCDF) { final double[] buckets = internalBuildHistogram(sketch, splitPoints); final long n = sketch.getN(); if (isCDF) { double subtotal = 0; for (int j = 0; j < buckets.length; j++) { subtotal += buckets[j]; buckets[j] = subtotal / n; //normalize by n } } else { // PMF for (int j = 0; j < buckets.length; j++) { buckets[j] /= n; //normalize by n } } return buckets; }