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

org.apache.commons.math.stat.descriptive.package.html Maven / Gradle / Ivy

Go to download

The Math project is a library of lightweight, self-contained mathematics and statistics components addressing the most common practical problems not immediately available in the Java programming language or commons-lang.

There is a newer version: 2.2
Show newest version


    
    
        Generic univariate summary statistic objects.

        

UnivariateStatistic API Usage Examples:

UnivariateStatistic:

/* evaluation approach */
double[] values = new double[] { 1, 2, 3, 4, 5 };
UnivariateStatistic stat = new Mean();
System.out.println("mean = " + stat.evaluate(values));

StorelessUnivariateStatistic:

/* incremental approach */
double[] values = new double[] { 1, 2, 3, 4, 5 };
StorelessUnivariateStatistic stat = new Mean();
System.out.println("mean before adding a value is NaN = " + stat.getResult());
for (int i = 0; i < values.length; i++) {
    stat.increment(values[i]);
    System.out.println("current mean = " + stat2.getResult());
}
stat.clear();
System.out.println("mean after clear is NaN = " + stat.getResult());




© 2015 - 2024 Weber Informatics LLC | Privacy Policy