Source: Internet
Author: User

Import org. Apache. commons. Math. Stat. descriptive. Moment. geometricmean;

Import org. Apache. commons. Math. Stat. descriptive. Moment. kurtosis;

Import org. Apache. commons. Math. Stat. descriptive. Moment. Mean;

Import org. Apache. commons. Math. Stat. descriptive. Moment. skewness;

Import org. Apache. commons. Math. Stat. descriptive. Moment. standarddeviation;

Import org. Apache. commons. Math. Stat. descriptive. Moment. variance;

Import org. Apache. commons. Math. Stat. descriptive. Rank. Max;

Import org. Apache. commons. Math. Stat. descriptive. Rank. min;

Import org. Apache. commons. Math. Stat. descriptive. Rank. percentile;

Import org. Apache. commons. Math. Stat. descriptive. Summary. product;

Import org. Apache. commons. Math. Stat. descriptive. Summary. sum;

Import org. Apache. commons. Math. Stat. descriptive. Summary. sumofsquares;

Public class testmathuserage {

Public static void main (string [] ARGs ){

Double [] values = new double [] {0.33, 1.33, 0.27333, 0.3, 0.501,

0.444, 0.44, 0.34496, 0.33, 0.3, 0.292, 0.667 };

/*

* System. Out. println ("Min:" + statutils. Min (values ));

* System. Out. println ("MAX:" + statutils. Max (values ));

* System. Out. println ("mean:" + statutils. Mean (values); // returns

* The arithmetic mean of the entries in the input array, or double. Nan

* If the array is empty system. Out. println ("product:" +

* Statutils. Product (values); // returns the product of the entries

* In the input array, or double. Nan if the array is empty.

* System. Out. println ("sum:" + statutils. sum (values); // returns

* The sum of the values in the input array, or double. Nan if the Array

* Is empty. system. Out. println ("Variance:" + statutils. Variance (

* Values); // returns the variance of the entries in the input

* Array, or double. Nan if the array is empty.

*/

Min = new min ();

Max max = new max ();

Mean mean = new mean (); // arithmetic mean value

Product = new product ();

Sum = new sum ();

Variance variance = new variance ();

System. Out. println ("Min:" + min. Evaluate (values ));

System. Out. println ("MAX:" + Max. Evaluate (values ));

System. Out. println ("mean:" + mean. Evaluate (values ));

System. Out. println ("product:" + product. Evaluate (values ));

System. Out. println ("sum:" + sum. Evaluate (values ));

System. Out. println ("Variance:" + variance. Evaluate (values ));

Percentile percentile = new percentile (); // percentile

Geometricmean geomean = new geometricmean (); // geometric mean. the n-th arithmetic root of the product of n positive numbers is the geometric mean of N numbers.

Skewness skewness = new skewness (); // skewness ();

Kurtosis = new kurtosis (); // kurtosis, kurtosis

Sumofsquares = new sumofsquares (); // sum of squares

Standarddeviation = new standarddeviation ();

System. Out. println ("80 percentile value :"

+ Percentile. Evaluate (values, 80.0 ));

System. Out. println ("geometric mean:" + geomean. Evaluate (values ));

System. Out. println ("skewness:" + skewness. Evaluate (values ));

System. Out. println ("kurtosis:" + kurtosis. Evaluate (values ));

System. Out. println ("sumofsquares:" + sumofsquares. Evaluate (values ));

// Standard variance

System. Out. println ("standarddeviation :"

+ Standarddeviation. Evaluate (values ));

}

}

Related Article