public Number getSkewness() { if (_statistics instanceof DescriptiveStatistics) { final double result = ((DescriptiveStatistics) _statistics).getSkewness(); if (Double.isNaN(result)) { return null; } return result; } return null; }
public Number getSkewness() { if (_statistics instanceof DescriptiveStatistics) { double result = ((DescriptiveStatistics) _statistics).getSkewness(); if (Double.isNaN(result)) { return null; } return result; } return null; }
@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(); }
/** * Generates a text report displaying univariate statistics from values * that have been added. Each statistic is displayed on a separate * line. * * @return String with line feeds displaying statistics */ @Override public String toString() { StringBuilder outBuffer = new StringBuilder(); String endl = "\n"; outBuffer.append("DescriptiveStatistics:").append(endl); outBuffer.append("n: ").append(getN()).append(endl); outBuffer.append("min: ").append(getMin()).append(endl); outBuffer.append("max: ").append(getMax()).append(endl); outBuffer.append("mean: ").append(getMean()).append(endl); outBuffer.append("std dev: ").append(getStandardDeviation()) .append(endl); outBuffer.append("median: ").append(getPercentile(50)).append(endl); outBuffer.append("skewness: ").append(getSkewness()).append(endl); outBuffer.append("kurtosis: ").append(getKurtosis()).append(endl); return outBuffer.toString(); }
/** * Generates a text report displaying univariate statistics from values * that have been added. Each statistic is displayed on a separate * line. * * @return String with line feeds displaying statistics */ @Override public String toString() { StringBuffer outBuffer = new StringBuffer(); String endl = "\n"; outBuffer.append("DescriptiveStatistics:").append(endl); outBuffer.append("n: ").append(getN()).append(endl); outBuffer.append("min: ").append(getMin()).append(endl); outBuffer.append("max: ").append(getMax()).append(endl); outBuffer.append("mean: ").append(getMean()).append(endl); outBuffer.append("std dev: ").append(getStandardDeviation()) .append(endl); outBuffer.append("median: ").append(getPercentile(50)).append(endl); outBuffer.append("skewness: ").append(getSkewness()).append(endl); outBuffer.append("kurtosis: ").append(getKurtosis()).append(endl); return outBuffer.toString(); }
/** * Generates a text report displaying univariate statistics from values * that have been added. Each statistic is displayed on a separate * line. * * @return String with line feeds displaying statistics */ public String toString() { StringBuffer outBuffer = new StringBuffer(); outBuffer.append("DescriptiveStatistics:\n"); outBuffer.append("n: " + getN() + "\n"); outBuffer.append("min: " + getMin() + "\n"); outBuffer.append("max: " + getMax() + "\n"); outBuffer.append("mean: " + getMean() + "\n"); outBuffer.append("std dev: " + getStandardDeviation() + "\n"); outBuffer.append("median: " + getPercentile(50) + "\n"); outBuffer.append("skewness: " + getSkewness() + "\n"); outBuffer.append("kurtosis: " + getKurtosis() + "\n"); return outBuffer.toString(); }
/** * Get the mean, variance and the third central moment from an array of doubles. * @param distribution the array of doubles * @return a float of length three. Encodes the mean, the variance and the * third central moment */ private static float[] getThreeMoments(double[] distribution) { DescriptiveStatistics descriptiveStatistics = new DescriptiveStatistics(); for (double val : distribution){ descriptiveStatistics.addValue(val); } float[] outVals = new float[3]; outVals[0] = (float) descriptiveStatistics.getMean(); outVals[1] = (float) descriptiveStatistics.getVariance(); outVals[2] = (float) descriptiveStatistics.getSkewness(); return outVals; }
break; case SKEWNESS: statsNode.put("skewness", descriptiveStatistics.getSkewness()); break; case KUTOSIS: statsNode.put("std-dev", descriptiveStatistics.getStandardDeviation()); statsNode.put("median", descriptiveStatistics.getPercentile(50)); statsNode.put("skewness", descriptiveStatistics.getSkewness()); statsNode.put("kurtosis", descriptiveStatistics.getKurtosis()); statsNode.put("variance", descriptiveStatistics.getVariance());
final DescriptiveStatistics descriptiveStatistics = (DescriptiveStatistics) s; final double kurtosis = descriptiveStatistics.getKurtosis(); final double skewness = descriptiveStatistics.getSkewness(); final double median = descriptiveStatistics.getPercentile(50.0); final double percentile25 = descriptiveStatistics.getPercentile(25.0);
final DescriptiveStatistics descriptiveStatistics = (DescriptiveStatistics) s; final double kurtosis = descriptiveStatistics.getKurtosis(); final double skewness = descriptiveStatistics.getSkewness(); final double median = descriptiveStatistics.getPercentile(50.0); final double percentile25 = descriptiveStatistics.getPercentile(25.0);