Here you can find the source of stddev(double[] arr)
public static double stddev(double[] arr)
//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; } }