FileDocCategorySizeDatePackage
StatExample.javaAPI DocExample3322Wed May 18 09:39:02 BST 2005com.discursive.jccook.math

StatExample

public class StatExample extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		double[] values = new double[] { 2.3, 5.4, 6.2, 7.3, 23.3 };

		System.out.println( "min: " + StatUtils.min( values ) );
		System.out.println( "max: " + StatUtils.max( values ) );
		System.out.println( "mean: " + StatUtils.mean( values ) );
		System.out.println( "product: " + StatUtils.product( values ) );
		System.out.println( "sum: " + StatUtils.sum( values ) );
		System.out.println( "variance: " + StatUtils.variance( values ) );

		// Measures from previous example
		Min min = new Min();
		System.out.println( "min: " + min.evaluate( values ) );
		Max max = new Max();
		System.out.println( "max: " + max.evaluate( values ) );
		Mean mean = new Mean();
		System.out.println( "mean: " + mean.evaluate( values ) );
		Product product = new Product();
		System.out.println( "product: " + product.evaluate( values ) );
		Sum sum = new Sum();
		System.out.println( "sum: " + sum.evaluate( values ) );
		Variance variance = new Variance();
		System.out.println( "variance: " + variance.evaluate( values ) );
		
		// New measures
		Percentile percentile = new Percentile();
		System.out.println( "80 percentile value: " + percentile.evaluate( values, 80.0 ) );
		GeometricMean geoMean = new GeometricMean();
		System.out.println( "geometric mean: " + geoMean.evaluate( values ) );
		StandardDeviation stdDev = new StandardDeviation();
		System.out.println( "standard dev: " + stdDev.evaluate( values ) );
		Skewness skewness = new Skewness();
		System.out.println( "skewness: " + skewness.evaluate( values ) );
		Kurtosis kurtosis = new Kurtosis();
		System.out.println( "kurtosis: " + kurtosis.evaluate( values ) );