Java Utililty Methods mean

List of utility methods to do mean

Description

The list of methods to do mean are organized into topic(s).

Method

doublestd(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;
doublestdDeviation(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]);
...
doublestdev(final double[] values, final double mean)
stdev
return Math.sqrt(variance(values, mean));
doublestdevm(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;
...