Here you can find the source of getStandardDeviation(double meanValue, ArrayList
public static double getStandardDeviation(double meanValue, ArrayList<Double> values)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static double getStandardDeviation(double meanValue, ArrayList<Double> values) { if (values.isEmpty()) { return -1.0; }/* www .j av a 2s . c o m*/ double sum = 0.0; for (Double value : values) { sum += Math.pow(meanValue - value, 2.0); } return Math.sqrt(sum / values.size()); } }