/** * {@inheritDoc} */ @Override public synchronized long getN() { return super.getN(); }
/** * Get the count of values that have been added to this series. * * @return count of values */ public long getCount() { return data.getN(); }
/** * @see org.apache.commons.math.stat.descriptive.DescriptiveStatistics#getN() */ public synchronized long getN() { return super.getN(); }
/** * {@inheritDoc} */ @Override public synchronized long getN() { return super.getN(); }
/** * Get the count of points added to this series. * * @return count of points.s */ public long getCount() { return xData.getN(); }
/** * Get the count of points added to this series. * * @return count of points.s */ public long getCount() { return xData.getN(); }
/** * Get the count of values that have been added to this series. * * @return count of values */ public long getCount() { return data.getN(); }
/** * Returns the standard deviation of the available values. * @return The standard deviation, Double.NaN if no values have been added * or 0.0 for a single value set. */ public double getStandardDeviation() { double stdDev = Double.NaN; if (getN() > 0) { if (getN() > 1) { stdDev = Math.sqrt(getVariance()); } else { stdDev = 0.0; } } return (stdDev); }
/** * Returns the standard deviation of the available values. * @return The standard deviation, Double.NaN if no values have been added * or 0.0 for a single value set. */ public double getStandardDeviation() { double stdDev = Double.NaN; if (getN() > 0) { if (getN() > 1) { stdDev = Math.sqrt(getVariance()); } else { stdDev = 0.0; } } return stdDev; }
public double getMean() { if (_stats.getN() == 0) { return 0; } return _stats.getMean(); }
public double getPercentile(int percentage) { if (_stats.getN() == 0) { return 0; } return _stats.getPercentile(percentage * 1.0); } }
public double getPercentile(int percentage) { if (_stats.getN() == 0) { return 0; } return _stats.getPercentile(percentage * 1.0); } }
public double getMean() { if (_stats.getN() == 0) { return 0; } return _stats.getMean(); }
/** * Returns the standard deviation of the available values. * @return The standard deviation, Double.NaN if no values have been added * or 0.0 for a single value set. */ public double getStandardDeviation() { double stdDev = Double.NaN; if (getN() > 0) { if (getN() > 1) { stdDev = FastMath.sqrt(getVariance()); } else { stdDev = 0.0; } } return stdDev; }
static void printTable(TreeBasedTable<Integer, Integer, DescriptiveStatistics> table) { System.out.printf("\t%s%n", StringUtils.join(table.columnKeySet(), "\t\t\t")); for (Map.Entry<Integer, Map<Integer, DescriptiveStatistics>> entry : table.rowMap() .entrySet()) { System.out.printf("%s\t", entry.getKey()); for (DescriptiveStatistics ds : entry.getValue().values()) { System.out.printf("%.2f\t%2f\t%d\t", ds.getMean(), ds.getStandardDeviation(), ds.getN()); } System.out.println(); } }
@Override public String getSummaryReport() { final StringBuilder outBuffer = new StringBuilder(); final DescriptiveStatistics ds = computeStats(); outBuffer.append("Aggregate P@" + N + " Statistics:\n"); outBuffer.append(String.format("%-15s\t%6d\n", "num_q", ds.getN())); outBuffer.append(String.format("%-15s\t%6.4f\n", "min", ds.getMin())); outBuffer.append(String.format("%-15s\t%6.4f\n", "max", ds.getMax())); outBuffer.append(String.format("%-15s\t%6.4f\n", "mean", ds.getMean())); outBuffer.append(String.format("%-15s\t%6.4f\n", "std dev", ds.getStandardDeviation())); outBuffer.append(String.format("%-15s\t%6.4f\n", "median", ds.getPercentile(50))); outBuffer.append(String.format("%-15s\t%6.4f\n", "skewness", ds.getSkewness())); outBuffer.append(String.format("%-15s\t%6.4f\n", "kurtosis", ds.getKurtosis())); return outBuffer.toString(); }
@Override public String getSummaryReport() { final StringBuilder outBuffer = new StringBuilder(); final DescriptiveStatistics ds = computeStats(); outBuffer.append("Aggregate P@" + N + " Statistics:\n"); outBuffer.append(String.format("%-15s\t%6d\n", "num_q", ds.getN())); outBuffer.append(String.format("%-15s\t%6.4f\n", "min", ds.getMin())); outBuffer.append(String.format("%-15s\t%6.4f\n", "max", ds.getMax())); outBuffer.append(String.format("%-15s\t%6.4f\n", "mean", ds.getMean())); outBuffer.append(String.format("%-15s\t%6.4f\n", "std dev", ds.getStandardDeviation())); outBuffer.append(String.format("%-15s\t%6.4f\n", "median", ds.getPercentile(50))); outBuffer.append(String.format("%-15s\t%6.4f\n", "skewness", ds.getSkewness())); outBuffer.append(String.format("%-15s\t%6.4f\n", "kurtosis", ds.getKurtosis())); return outBuffer.toString(); }
/** * Adds the value to the dataset. If the dataset is at the maximum size * (i.e., the number of stored elements equals the currently configured * windowSize), the first (oldest) element in the dataset is discarded * to make room for the new value. * * @param v the value to be added */ public void addValue(double v) { if (windowSize != INFINITE_WINDOW) { if (getN() == windowSize) { eDA.addElementRolling(v); } else if (getN() < windowSize) { eDA.addElement(v); } } else { eDA.addElement(v); } }
/** * Add a new value to the series. * * @param v * the new value */ public void addValue(double v) { data.addValue(v); series.add(data.getN() - 1, v); }
/** * Add a new value to the series. * * @param v * the new value */ public void addValue(double v) { data.addValue(v); series.add(data.getN() - 1, v); }