List of utility methods to do List Mean
double | calculateStDev(List calculate St Dev int listSize = values.size(); Double sumOfDiffSquared = 0.0; for (Double value : values) { double diffFromMean = value - mean; sumOfDiffSquared += ((diffFromMean * diffFromMean) / (listSize - 1)); double variance = sumOfDiffSquared; return Math.sqrt(variance); ... |
double | computeMean(List extends Number> fs) compute Mean Double sum = 0.0; for (Number d : fs) sum += d.doubleValue(); return sum / fs.size(); |
double | geometricMean(List vals, double replacement) Return the geometric mean of the absolute values of elements int numVals = vals.size(); double product = 1.0; for (int i = 0; i < numVals; i++) { Double val = (Double) vals.get(i); double dval = (val.isNaN()) ? replacement : val.doubleValue(); if (dval == 0.0) { dval = replacement; product *= Math.abs(dval); return (Math.pow(product, 1.0 / (double) numVals)); |
double | getHMean(List Compute mean for a given set of numbers Iterator<Number> it = harray.iterator(); double vsum = 0, mean = 0; int count = 0; while (it.hasNext()) { Number vl = it.next(); double val = vl.doubleValue(); vsum += val; count++; ... |
double | getMean(List get Mean double mean = 0; final int n = data.size(); if (n < 2) { return Double.NaN; for (int i = 0; i < n; i++) { mean += data.get(i); mean /= n; return mean; |
double | getMean(List get Mean double sum = 0.0; for (double value : list) { sum += value; return sum / list.size(); |
double | getStandardDeviation(double meanValue, List get Standard Deviation if (values.isEmpty()) { return -1.0; double sum = 0.0; for (Double value : values) { sum += Math.pow(meanValue - value, 2.0); return Math.sqrt(sum / (values.size() - 1)); ... |
Double | getStandardDeviation(List get Standard Deviation double sum = 0; int i = 0; for (Double d : doubles) { if (d == null) continue; sum += (d - mean) * (d - mean); i++; return i == 0 ? null : Math.sqrt(sum / i); |
double | getStandardDeviationOfMean(List get Standard Deviation Of Mean return getStandardDeviation(doubles, getMean(doubles));
|
double | mean(double[] list) mean return sum(list) / list.length;
|