Java stddev stddev(double[] arr)

Here you can find the source of stddev(double[] arr)

Description

stddev

License

Open Source License

Declaration

public static double stddev(double[] arr) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double stddev(double[] arr) {
        double mean = mean(arr);
        double sum = 0;
        for (double d : arr) {
            sum += Math.pow(d - mean, 2);
        }//  ww  w.  j  a  v a2s . c om
        return Math.sqrt(sum / (arr.length - 1));
    }

    public static double mean(double[] arr) {
        double sum = 0;
        for (double d : arr)
            sum += d;
        return sum / arr.length;
    }
}

Related

  1. stdarr(int[] a, double avg)
  2. stddev(Collection a)
  3. stdDev(Collection coll)
  4. stddev(double sum, double sqSum, int numberValues)
  5. stddev(double[] a)
  6. stdDev(double[] array)
  7. stdDev(double[] data)
  8. stddev(double[] observations)
  9. stddev(final double[] in, final int start, final int length)