public static Double percentile(NumericColumn<?> data, Double percentile) { return StatUtils.percentile(removeMissing(data), percentile); }
@Test public void testPercentileFunctions() { double[] values = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; DoubleColumn c = DoubleColumn.create("test", values); c.appendCell(""); assertEquals(1, countMissing.summarize(c), 0.0001); assertEquals(11, countWithMissing.summarize(c), 0.0001); assertEquals(StatUtils.percentile(values, 90), percentile90.summarize(c), 0.0001); assertEquals(StatUtils.percentile(values, 95), percentile95.summarize(c), 0.0001); assertEquals(StatUtils.percentile(values, 99), percentile99.summarize(c), 0.0001); assertEquals(10, countUnique.summarize(c), 0.0001); } }
public static double percentile(double[] data, double percentile) { return StatUtils.percentile(data, percentile); }
public void restrictRegToPercentile(final double p1, final double p2) { final double x1 = StatUtils.percentile(regressionXdata, p1); final double x2 = StatUtils.percentile(regressionXdata, p2); restrictRegToRange(x1, x2); }
/** * Calculates the median. * * @param fittedData * If {@code true}, calculation is performed on polynomial fitted * values, otherwise from sampled data * * @return the median of intersection counts */ public double getMedian(final boolean fittedData) { if (fittedData) { validateFit(); return StatUtils.percentile(fCounts, 50); } return StatUtils.percentile(inputCounts, 50); }
public static Double percentile(NumericColumn<?> data, Double percentile) { return StatUtils.percentile(removeMissing(data), percentile); }
/** * @param collection * The collection of items * @param ratio * The percentage * @return Returns an estimate of the <code>p</code>th percentile of the values in collection */ public static double percentile(final Collection<Double> collection, final Ratio ratio) { final double[] array = toDoubleArray(collection); return StatUtils.percentile(array, ratio.asPercentage()); }
/** * Get the mean of the data set. * * @param data the data set. * @return the mean of the data set. */ private float[] getMean(ArrayDeque<float[]> data) { float[] mean = new float[data.getFirst().length]; double[][] values = new double[data.getFirst().length][data.size()]; int index = 0; for (float[] axis : data) { for (int i = 0; i < axis.length; i++) { values[i][index] = axis[i]; } index++; } for (int i = 0; i < mean.length; i++) { mean[i] = (float) StatUtils.percentile(values[i], 50); } return mean; }
if (nSpans > 1) { if (spanType == MEDIAN) { // 50th percentile counts = StatUtils.percentile(binsamples, 50); } else if (spanType == MEAN) { // mean counts = StatUtils.mean(binsamples);
return StatUtils.min(aggregationValues); case PERCENTILE90: return StatUtils.percentile(aggregationValues, 90); case PERCENTILE95: return StatUtils.percentile(aggregationValues, 95); case PRODUCT: return StatUtils.product(aggregationValues);
return StatUtils.min(aggregationValues); case PERCENTILE90: return StatUtils.percentile(aggregationValues, 90); case PERCENTILE95: return StatUtils.percentile(aggregationValues, 95); case PRODUCT: return StatUtils.product(aggregationValues);
final double standardDeviationtriggerEnd = FastMath.sqrt(StatUtils.variance(convertToArray(triggerEnd))); final double medianUnitChange = StatUtils.percentile(convertToArray(unitChange), 50); final double mediansendSPARQL = StatUtils.percentile(convertToArray(sendSPARQL), 50); final double mediananswerOfServerToOM = StatUtils.percentile(convertToArray(answerOfServerToOM), 50); final double mediantriggerImplFromRSB = StatUtils.percentile(convertToArray(triggerImplFromRSB), 50); final double mediantriggerEnd = StatUtils.percentile(convertToArray(triggerEnd), 50);