All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ciir.umass.edu.stats.BasicStats Maven / Gradle / Ivy

There is a newer version: 2.10.1
Show newest version
package ciir.umass.edu.stats;

import ciir.umass.edu.utilities.RankLibError;

public class BasicStats {

    public static double mean(final double[] values) {
        double mean = 0.0;
        if (values.length == 0) {
            throw RankLibError.create("Error in BasicStats::mean(): Empty input array.");
        }
        for (final double value : values) {
            mean += value;
        }
        return mean / values.length;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy