Java Collection Mean getMean(Collection data)

Here you can find the source of getMean(Collection data)

Description

get Mean

License

Open Source License

Declaration

public static double getMean(Collection<Double> data) 

Method Source Code

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

import java.util.Collection;

public class Main {
    public static double getMean(Collection<Double> data) {
        double sum = 0.0;
        for (double d : data) {
            sum += d;/*w  ww  .  j a  v a2s.c  o m*/
        }
        return sum / data.size();
    }
}

Related

  1. calculateMean(Collection values)
  2. calculateMean(Collection values)
  3. calculateMean(Collection values)
  4. getMean(Collection cluster)
  5. getMean(final Collection collection)
  6. getVariance(Collection data, Number mean)
  7. mean(Collection coll)