@Override public Double summarize(NumericColumn<?> column) { return StatUtils.sumSq(removeMissing(column)); } };
@Override public Double summarize(NumericColumn<?> column) { return StatUtils.min(removeMissing(column)); } };
@Override public Double summarize(NumericColumn<?> column) { return StatUtils.sum(removeMissing(column)); } };
@Override public Double summarize(NumericColumn<?> column) { return StatUtils.mean(removeMissing(column)); } };
@Override public Double summarize(NumericColumn<?> column) { double[] values = removeMissing(column); return StatUtils.variance(values); } };
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns <code>Double.NaN</code> if no values have been added. * Returns 0 if at least one value has been added, but v is not comparable * to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(Comparable<?> v) { final long sumFreq = getSumFreq(); if (sumFreq == 0) { return Double.NaN; } return (double) getCumFreq(v) / (double) sumFreq; }
@Override public Double summarize(NumericColumn<?> column) { return StatUtils.max(removeMissing(column)); } };
/** * Adds 1 to the frequency count for v. * * @param v the value to add. * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long */ public void addValue(long v) throws MathIllegalArgumentException { addValue(Long.valueOf(v)); }
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(int v) { return getCumPct(Long.valueOf(v)); }
@Override public Double summarize(NumericColumn<?> column) { return StatUtils.geometricMean(removeMissing(column)); } };
/** * Returns the mean of the (signed) differences between corresponding elements of the * input arrays -- i.e., sum(sample1[i] - sample2[i]) / sample1.length. * * @param sample1 the first array * @param sample2 the second array * @return mean of paired differences * @throws DimensionMismatchException if the arrays do not have the same * (positive) length. * @throws NoDataException if the sample arrays are empty. */ public static double meanDifference(final double[] sample1, final double[] sample2) throws DimensionMismatchException, NoDataException{ return sumDifference(sample1, sample2) / sample1.length; }
@Override public Double summarize(NumericColumn<?> column) { return StatUtils.product(removeMissing(column)); } };
@Override public Double summarize(NumericColumn<?> column) { return StatUtils.sumLog(removeMissing(column)); } };
/** * Returns the cumulative frequency of values less than or equal to v. * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values equal to v */ public long getCumFreq(long v) { return getCumFreq(Long.valueOf(v)); }
@Override public Double summarize(NumericColumn<?> column) { return StatUtils.populationVariance(removeMissing(column)); } };
/** * Adds 1 to the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @throws MathIllegalArgumentException if <code>v</code> is not comparable with previous entries */ public void addValue(Comparable<?> v) throws MathIllegalArgumentException { incrementValue(v, 1); }
@Override public Double summarize(NumericColumn<?> column) { return Math.sqrt(StatUtils.variance(removeMissing(column))); } };
@Override public Double summarize(NumericColumn<?> data) { return StatUtils.max(data.asDoubleArray()) + 1000; } };
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(long v) { return getCumPct(Long.valueOf(v)); }