hultig.util
Class BasicStats

java.lang.Object
  extended by hultig.util.BasicStats

public class BasicStats
extends Object

The BasicStats class represents basic statistics about a certain numeric sequence. It was thought to compute basic statistic quantities, like mean and variance, iteratively for a flow of numeric quantities.

University of Beira Interior (UBI)
Centre For Human Language Technology and Bioinformatics (HULTIG)


Constructor Summary
BasicStats()
          Constructor.
 
Method Summary
 void addValue(double xi)
          Adds a new double value to this statistics
 void addValue(int xi)
          Adds a new int value to this statistics.
 double getMax()
          Gives the maximum value added.
 double getMean()
          Gives the Mean value for this statistics.
 double getMin()
          Gives the minimum value added.
 long getNumValues()
          Gives the number of values computed for this statistics.
 double getStandDev()
          Gives the Standard Deviation for this statistics.
 double getVariance()
          Gives the Variance value for this statistics.
static void main(String[] args)
          For testing/demonstration we use two samples of seven numbers which give rise to near the same mean but very different standard deviation.
 void print(String varname)
          Outputs the main statistic parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicStats

public BasicStats()
Constructor.

Method Detail

addValue

public void addValue(double xi)
Adds a new double value to this statistics

Parameters:
xi - The value to add.

addValue

public void addValue(int xi)
Adds a new int value to this statistics.

Parameters:
xi - The value to add.

getNumValues

public long getNumValues()
Gives the number of values computed for this statistics.

Returns:
The number of values.

getMean

public double getMean()
Gives the Mean value for this statistics.

Returns:
The Mean value.

getVariance

public double getVariance()
Gives the Variance value for this statistics.

Returns:
The Variance value.

getStandDev

public double getStandDev()
Gives the Standard Deviation for this statistics.

Returns:
The Standard Deviation value.

getMin

public double getMin()
Gives the minimum value added.

Returns:
The minimum value.

getMax

public double getMax()
Gives the maximum value added.

Returns:
The maximum value.

print

public void print(String varname)
Outputs the main statistic parameters.


main

public static void main(String[] args)
For testing/demonstration we use two samples of seven numbers which give rise to near the same mean but very different standard deviation.

Parameters:
args -