@Override public Double summarize(NumericColumn<?> column) { return StatUtils.min(removeMissing(column)); } };
@Override public Double summarize(NumericColumn<?> column) { double[] data = removeMissing(column); return StatUtils.max(data) - StatUtils.min(data); } };
@Override public Double summarize(NumericColumn<?> column) { return StatUtils.min(removeMissing(column)); } };
@Override public double reduce(double[] data) { return StatUtils.min(data); }
/** * Returns the lowest value of intersection count. * * @param fittedData * If {@code true}, calculation is performed on polynomial fitted * values, otherwise from sampled data * * @return the lowest value of intersection counts */ public double getMin(final boolean fittedData) { if (fittedData) { validateFit(); return StatUtils.min(fCounts); } return StatUtils.min(inputCounts); }
@Override public double reduce(double[] data) { return StatUtils.max(data) - StatUtils.min(data); } };
@Override public Double summarize(NumericColumn<?> column) { double[] data = removeMissing(column); return StatUtils.max(data) - StatUtils.min(data); } };
private void setLUT(final ArrayList<Roi> rois, final String property, final ColorTable ct, final int alpha) throws IllegalArgumentException { String fProperty = COUNT; if (property != null && property.toLowerCase().startsWith("radi")) // radi[i|us] fProperty = RADIUS; final double[] mappingValues = (RADIUS.equals(fProperty)) ? profile.radiiAsArray() : profile.countsAsArray(); final double min = StatUtils.min(mappingValues); final double max = StatUtils.max(mappingValues); for (final Roi roi : rois) { final double value = Double.parseDouble(roi.getProperty(fProperty)); final int idx = (int) Math.round((ct.getLength() - 1) * (value - min) / (max - min)); final Color color = new Color(ct.get(ColorTable.RED, idx), ct.get(ColorTable.GREEN, idx), ct.get(ColorTable.BLUE, idx), alpha); roi.setStrokeColor(color); } }
log.info("Min value: {}", StatUtils.min(values)); log.info("Max value: {}", StatUtils.max(values)); log.info("Median: {}", StatUtils.mean(values));
@Test public void toMinMaxReverse() { final Random random = RandomRegistry.getRandom(); final double[] numbers = random.doubles().limit(1000).toArray(); final MinMax<Double> minMax = Arrays.stream(numbers) .mapToObj(Double::valueOf) .collect(MinMax.toMinMax((a, b) -> b.compareTo(a))); Assert.assertEquals(minMax.getMin(), StatUtils.max(numbers)); Assert.assertEquals(minMax.getMax(), StatUtils.min(numbers)); }
@Test public void acceptReverseMinMax() { final Random random = RandomRegistry.getRandom(); final double[] numbers = random.doubles().limit(1000).toArray(); final MinMax<Double> minMax = MinMax.of((a, b) -> b.compareTo(a)); Arrays.stream(numbers) .mapToObj(Double::valueOf) .forEach(minMax); Assert.assertEquals(minMax.getMin(), StatUtils.max(numbers)); Assert.assertEquals(minMax.getMax(), StatUtils.min(numbers)); }
@Test public void toMinMaxNormal() { final Random random = RandomRegistry.getRandom(); final double[] numbers = random.doubles().limit(1000).toArray(); final MinMax<Double> minMax = Arrays.stream(numbers) .mapToObj(Double::valueOf) .collect(MinMax.toMinMax()); Assert.assertEquals(minMax.getMin(), StatUtils.min(numbers)); Assert.assertEquals(minMax.getMax(), StatUtils.max(numbers)); }
@Test public void acceptNormalMinMax() { final Random random = RandomRegistry.getRandom(); final double[] numbers = random.doubles().limit(1000).toArray(); final MinMax<Double> minMax = MinMax.of(); Arrays.stream(numbers) .mapToObj(Double::valueOf) .forEach(minMax); Assert.assertEquals(minMax.getMin(), StatUtils.min(numbers)); Assert.assertEquals(minMax.getMax(), StatUtils.max(numbers)); }
return StatUtils.mean(aggregationValues); case MIN: return StatUtils.min(aggregationValues); case PERCENTILE90: return StatUtils.percentile(aggregationValues, 90);
return StatUtils.mean(aggregationValues); case MIN: return StatUtils.min(aggregationValues); case PERCENTILE90: return StatUtils.percentile(aggregationValues, 90);