Java Variance Variance(double[] in, double mean)

Here you can find the source of Variance(double[] in, double mean)

Description

Variance

License

Open Source License

Declaration

public static final double Variance(double[] in, double mean) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static final double Variance(double[] in, double mean) {
        double sum = 0.0;
        int nelem = 0;
        for (int i = 0, s = in.length; i < s; i++)
            sum += (in[i] - mean) * (in[i] - mean);
        return sum / (in.length - 1.0);
    }//from   w  ww .  j  av  a  2 s .  c  o  m
}

Related

  1. variance(double[] arr)
  2. variance(double[] arr)
  3. variance(double[] array)
  4. variance(double[] array)
  5. variance(double[] d)
  6. variance(double[] population)
  7. variance(double[] v)
  8. variance(double[] vals)
  9. variance(double[] values)