Java Utililty Methods stddev

List of utility methods to do stddev

Description

The list of methods to do stddev are organized into topic(s).

Method

Doublestdev(Collection values)
stdev
List<Double> filteredValues = filterNulls(values);
if (filteredValues.size() < 2)
    return null;
Double average = average(filteredValues);
if (average == null)
    return null;
double variance = 0;
for (Double value : filteredValues) {
...
doublestdev(Collection values)
stdev
double ret = 0;
double mean = average(values);
for (Double val : values)
    ret += Math.pow(val - mean, 2);
return Math.sqrt(ret / (values.size() - 1));
doublestdev(double... array)
stdev
return Math.sqrt(variance(array));
doublestdev(double[] array)
stdev
double var = var(array);
return Math.sqrt(var);
doublestdev(final double... values)
Calculates and returns the standard deviation of an array of double.
return stdev(values, ave(values));
doublestdev(long[] vals, long average)
stdev
long sum = 0;
for (Long i : vals)
    sum += Math.pow((i - average), 2);
return Math.sqrt(sum / (vals.length - 1));