List of utility methods to do mean
double | mean(double[] a, int n) Returns the mean. double avg = 0.0; for (double v : a) { avg += v; return avg / n; |
double | mean(double[] aArray) Computes the arithmetic mean of the values in the given array. return sum(aArray) / aArray.length;
|
double | mean(double[] an) mean if (an == null) { throw new NullPointerException("Array cannot be null"); if (an.length == 0) { throw new IllegalArgumentException("Array has zero length"); double sum = 0.0; for (int n = 0; n < an.length; n++) { ... |
double | mean(double[] arr) mean if (arr == null || arr.length == 0) return 0; return sum(arr) / arr.length; |
double | mean(double[] array) mean if (array.length == 0) throw new IllegalArgumentException("length cannot be 0."); double sum = 0; for (double d : array) { sum += d; return sum / array.length; |
double | mean(Double[] array) Returns the mean of values in an array return sum(array) / array.length;
|
double | mean(double[] data) Compute the mean of all elements in the array. double mean = 0; for (int i = 0; i < data.length; i++) { if (Double.isNaN(data[i])) throw new IllegalArgumentException("NaN not allowed in mean calculation"); mean += data[i]; mean /= data.length; return mean; ... |
double | mean(double[] data) mean return mean(data, 0, data.length - 1);
|
double | mean(double[] doubleArray) mean return _sum(doubleArray) / doubleArray.length;
|
double | mean(double[] list) mean return sum(list) / list.length;
|