Java Mean Calculate mean(ArrayList values)

Here you can find the source of mean(ArrayList values)

Description

mean

License

Open Source License

Declaration

static Double mean(ArrayList<Double> values) 

Method Source Code

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

import java.util.ArrayList;

public class Main {
    static Double mean(ArrayList<Double> values) {
        return sum(values) / values.size();
    }// w w  w. j  ava 2 s  .c o  m

    private static Double sum(ArrayList<Double> values) {
        Double sum = 0.0;
        for (Double num : values) {
            sum += num;
        }
        return sum;
    }
}

Related

  1. computeMean(float[] data)
  2. computeMean(int val1, int val2, float ratio)
  3. computeMean(int[][] pixels)
  4. computeMeanSquaredError(double[] trueValues, double[] predValues)
  5. computeMeanSquareError(double[] x, double[] y)
  6. mean(ArrayList a)
  7. mean(Double... values)