public double getStandardDeviation() { final double mean = getMean(); double count = 0; double total = 0; for (final Bin<K> bin : map.values()) { final double localCount = bin.getValue(); final double value = bin.getIdValue(); count += localCount; total += localCount * pow(value - mean, 2); } return Math.sqrt(total / (count-1)); }
/** Gets the geometric mean of the distribution. */ public double getGeometricMean() { double total = 0; double count = 0; for (final Bin<K> bin : values()) { total += bin.value * log(bin.getIdValue()); count += bin.value; } return exp(total / count); }
/** Gets the geometric mean of the distribution. */ public double getGeometricMean() { double total = 0; double count = 0; for (final Bin bin : values()) { total += bin.value * log(bin.getIdValue()); count += bin.value; } return exp(total / count); }
public double getMin() { return firstEntry().getValue().getIdValue(); }
/** * Returns the key with the lowest count. * @throws UnsupportedOperationException if this histogram does not store instances of Number */ public double getMin() { return map.firstEntry().getValue().getIdValue(); }
/** * Returns the sum of the products of the histgram bin ids and the number of entries in each bin. * Note: This is only supported if this histogram stores instances of Number. */ public double getSum() { double total = 0; for (final Bin<K> bin : map.values()) { total += bin.getValue() * bin.getIdValue(); } return total; }
public double getStandardDeviation() { final double mean = getMean(); double count = 0; double total = 0; for (final Bin<K> bin : map.values()) { final double localCount = bin.getValue(); final double value = bin.getIdValue(); count += localCount; total += localCount * pow(value - mean, 2); } return Math.sqrt(total / (count-1)); }
/** * Returns the sum of the products of the histgram bin ids and the number of entries in each bin. * Note: This is only supported if this histogram stores instances of Number. */ public double getSum() { double total = 0; for (final Bin<K> bin : map.values()) { total += bin.getValue() * bin.getIdValue(); } return total; }
/** Gets the geometric mean of the distribution. */ public double getGeometricMean() { double total = 0; double count = 0; for (final Bin<K> bin : values()) { total += bin.value * log(bin.getIdValue()); count += bin.value; } return exp(total / count); }
/** Gets the median absolute deviation of the distribution. */ public double getMedianAbsoluteDeviation() { final double median = getMedian(); final Histogram<Double> deviations = new Histogram<Double>(); for (final Bin bin : values()) { final double dev = abs(bin.getIdValue() - median); deviations.increment(dev, bin.getValue()); } return deviations.getMedian(); }
/** * Returns the sum of the products of the histgram bin ids and the number of entries in each bin. */ public double getSum() { double total = 0; for (final Bin bin : values()) { total += bin.getValue() * bin.getIdValue(); } return total; }
/** * Returns the key with the highest count. * @throws UnsupportedOperationException if this histogram does not store instances of Number */ public double getMax() { return map.lastEntry().getValue().getIdValue(); }
/** Gets the median absolute deviation of the distribution. */ public double getMedianAbsoluteDeviation() { final double median = getMedian(); final Histogram<Double> deviations = new Histogram<>(); for (final Bin<K> bin : values()) { final double dev = abs(bin.getIdValue() - median); deviations.increment(dev, bin.getValue()); } return deviations.getMedian(); }
public double getStandardDeviation() { final double mean = getMean(); double count = 0; double total = 0; for (final Bin bin : values()) { final double localCount = bin.getValue(); final double value = bin.getIdValue(); count += localCount; total += localCount * pow(value - mean, 2); } return Math.sqrt(total / (count-1)); }
/** Gets the median absolute deviation of the distribution. */ public double getMedianAbsoluteDeviation() { final double median = getMedian(); final Histogram<Double> deviations = new Histogram<>(); for (final Bin<K> bin : values()) { final double dev = abs(bin.getIdValue() - median); deviations.increment(dev, bin.getValue()); } return deviations.getMedian(); }
public double getMax() { return lastEntry().getValue().getIdValue(); }
/** Returns id of the Bin that's the mode of the distribution (i.e. the largest bin). * @throws UnsupportedOperationException if this histogram does not store instances of Number */ public double getMode() { return getModeBin().getIdValue(); }
/** * Returns the key with the lowest count. * @throws UnsupportedOperationException if this histogram does not store instances of Number */ public double getMin() { return map.firstEntry().getValue().getIdValue(); }
/** Returns id of the Bin that's the mode of the distribution (i.e. the largest bin). * @throws UnsupportedOperationException if this histogram does not store instances of Number */ public double getMode() { return getModeBin().getIdValue(); }
/** * Returns the key with the highest count. * @throws UnsupportedOperationException if this histogram does not store instances of Number */ public double getMax() { return map.lastEntry().getValue().getIdValue(); }