Here you can find the source of stdevm(double[] values, double mean)
public static double stdevm(double[] values, double mean)
//package com.java2s; //License from project: Apache License public class Main { public static double stdevm(double[] values, double mean) { if (values == null || Double.isNaN(mean)) { return Double.NaN; }/*from w ww. j a v a2 s. c om*/ double sum_sq = 0; int n = 0; for (int k = 0; k < values.length; k++) { if (Double.isNaN(values[k])) { continue; } n++; sum_sq += (values[k] - mean) * (values[k] - mean); } if (n == 0) { return Double.NaN; } return Math.sqrt(sum_sq / n); } }