Java stddev stddev(float[] data)

Here you can find the source of stddev(float[] data)

Description

stddev

License

LGPL

Declaration

public static double stddev(float[] data) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static double stddev(float[] data) {
        double d = 0;
        float mn = (float) mean(data);
        for (int i = 0; i < data.length; i++)
            d += (data[i] - mn) * (data[i] - mn);
        d /= data.length;/*w  w w  .  jav a  2s. c o  m*/
        return Math.sqrt(d);
    }

    public static double mean(float[] data) {
        double d = 0;
        for (int i = 0; i < data.length; i++)
            d += data[i];
        return d / data.length;
    }
}

Related

  1. stdDev(double[] array)
  2. stdDev(double[] data)
  3. stddev(double[] observations)
  4. stddev(final double[] in, final int start, final int length)
  5. stddev(final int[] scores)
  6. stddev(int[] values, int start, int length)
  7. stdDev(Integer[] values)
  8. stddev(long[] samples)
  9. stddev(Number[] array, boolean isSample)