Java Standard Deviation Calculate computeStdDev(double[] results, double mean)

Here you can find the source of computeStdDev(double[] results, double mean)

Description

compute Std Dev

License

BSD License

Declaration

public static double computeStdDev(double[] results, double mean) 

Method Source Code

//package com.java2s;
/*// w w w.ja  v  a  2s .  co  m
 * This file is part of an unofficial ISO20008-2.2 sample implementation to
 * evaluate certain schemes for their applicability on Android-based mobile
 * devices. The source is licensed under the modified 3-clause BSD license,
 * see the readme.
 * 
 * The code was published in conjunction with the publication called 
 * "Group Signatures on Mobile Devices: Practical Experiences" by
 * Potzmader, Winter, Hein, Hanser, Teufl and Chen
 */

public class Main {
    public static double computeStdDev(double[] results, double mean) {
        double stddev = 0;
        for (double single : results)
            stddev += (mean - single) * (mean - single);
        stddev = Math.sqrt(stddev / results.length);

        return stddev;
    }
}

Related

  1. calcStdDeviation(double[] population)
  2. calcStdDeviation(int sampleCount, long total, long sumOfSquares)
  3. computeStddev(double[] array, double mean)
  4. computeStddev(float[] array, float mean)