Java List std getStandardDeviation(List list)

Here you can find the source of getStandardDeviation(List list)

Description

get Standard Deviation

License

Open Source License

Declaration

public static double getStandardDeviation(List<Double> list) 

Method Source Code


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

import java.util.List;

public class Main {
    public static double getStandardDeviation(List<Double> list) {
        return Math.sqrt(getVariance(list));
    }//www .j  a  v  a2 s. com

    public static double getVariance(List<Double> list) {
        double mean = getMean(list);
        double accumulator = 0;
        for (double value : list) {
            accumulator += (value - mean) * (value - mean);
        }
        return accumulator / list.size();
    }

    public static double getMean(List<Double> list) {
        double sum = 0.0;
        for (double value : list) {
            sum += value;
        }
        return sum / list.size();
    }
}

Related

  1. calculateStandardDeviation(List doubleList)
  2. getStandardDeviation(List data)
  3. getStandardDeviation(List values)
  4. getStdDeviation(List numbers)
  5. standardDeviation(List data)
  6. standardDeviation(List values)