List of utility methods to do stddev
float | std(float[][] arr) Calculate the standard deviation of a 2D array. return (float) Math.sqrt(var(arr)); |
double | std(long[] array) Returns the standard deviation of an array using the Welford's method. if (array.length == 0) return 0; double M = 0.0; double S = 0.0; int k = 1; for (long value : array) { double tmpM = M; M += (value - tmpM) / k; ... |
double | stdarr(int[] a, double avg) stdarr double res = 0.0; for (int i = 0; i < a.length; i++) res += (a[i] - avg) * (a[i] - avg); return (Math.sqrt(res / (a.length - 1))); |
double | stddev(Collection a) Compute the sample standard deviation for a Collection of numeric types return Math.sqrt(variance(a));
|
double | stdDev(Collection extends Number> coll) std Dev if (coll == null || coll.size() < 2) throw new IllegalArgumentException(); double mean = mean(coll); double res = 0; for (Number n : coll) { double d = n.doubleValue() - mean; res += d * d; return res / (coll.size() - 1); |
double | stddev(double sum, double sqSum, int numberValues) stddev double variance = (sqSum - (sum * sum) / numberValues) / (numberValues - 1); return Math.sqrt(variance); |
double | stddev(double[] a) Computes the standard deviation of an array double std = 0; double ave = mean(a); for (double d : a) std += (d - ave) * (d - ave); return Math.sqrt(std / (double) a.length); |
double | stddev(double[] arr) stddev double mean = mean(arr); double sum = 0; for (double d : arr) { sum += Math.pow(d - mean, 2); return Math.sqrt(sum / (arr.length - 1)); |
double | stdDev(double[] array) std Dev double mean = 0.0; double total = 0.0; for (int m = 0; m < array.length; m++) { total += array[m]; mean = total / array.length; return stdDev(array, mean); |
double | stdDev(double[] data) Compute the standard deviation of the given data double mean = 0; double S = 0; for (int i = 0; i < data.length; i++) { double delta = data[i] - mean; mean += delta / (i + 1); S += delta * (data[i] - mean); return Math.sqrt(S / data.length); ... |