List of utility methods to do mean
double | std(double[] array, double mean) Computes the standard deviation of the values in the array. double sum = 0; for (int i = 0; i < array.length; i++) { sum += Math.pow((array[i] - mean), 2); double stDev = Math.sqrt(sum / (array.length - 1)); return stDev; |
double | stdDeviation(int[] values, double mean) std Deviation double sum = 0.0; for (int index = 0; index < values.length; index++) sum += (mean - values[index]) * (mean - values[index]); return Math.sqrt(sum / values.length); |
double[] | stdDevsOfRows(double[][] matrix, double[] means) Compute the standard deviations along each row double[] stds = new double[matrix.length]; for (int r = 0; r < matrix.length; r++) { double sumSqs = 0.0; for (int c = 0; c < matrix[r].length; c++) { sumSqs += (matrix[r][c] - means[r]) * (matrix[r][c] - means[r]); stds[r] = sumSqs / (double) (matrix[r].length - 1); stds[r] = Math.sqrt(stds[r]); ... |
double | stdev(final double[] values, final double mean) stdev return Math.sqrt(variance(values, mean));
|
double | stdevm(double[] values, double mean) stdevm if (values == null || Double.isNaN(mean)) { return Double.NaN; double sum_sq = 0; int n = 0; for (int k = 0; k < values.length; k++) { if (Double.isNaN(values[k])) { continue; ... |