org.gersteinlab.tyna.core.util
Class SimpleStats

java.lang.Object
  extended by org.gersteinlab.tyna.core.util.SimpleStats

public class SimpleStats
extends java.lang.Object

        This class provides utility methods for calculating some basic
        statistics from a series of numbers.
        

Version:
1.0 (October 31, 2005) Change History: 1.0 - Initial version
Author:
Kevin Yuk-Lap Yip

Field Summary
protected  int count
          Number of the values.
protected  double max
          Maximum of the values.
protected  double min
          Minimum of the values.
protected  double sum
          Sum of the values.
protected  double sumSq
          Sum of squares of the values.
 
Constructor Summary
SimpleStats()
          Create a new empty object.
 
Method Summary
 void addValue(double value)
          Add a new value.
 int getCount()
          Get the number of values added.
 double getMax()
          Get the maximum of the values.
 double getMean()
          Get the mean of the values.
 double getMin()
          Get the minimum of the values.
 double getStdDev()
          Get the standard deviation of the values.
 double getVariance()
          Get the variance of the values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

protected int count
Number of the values.


sum

protected double sum
Sum of the values.


sumSq

protected double sumSq
Sum of squares of the values.


min

protected double min
Minimum of the values.


max

protected double max
Maximum of the values.

Constructor Detail

SimpleStats

public SimpleStats()
Create a new empty object.

Method Detail

addValue

public void addValue(double value)
Add a new value.

Parameters:
value - The value

getCount

public int getCount()
Get the number of values added.

Returns:
The number

getMean

public double getMean()
Get the mean of the values.

Returns:
The mean

getVariance

public double getVariance()
Get the variance of the values.

Returns:
The variance

getStdDev

public double getStdDev()
Get the standard deviation of the values.

Returns:
The standard deviation

getMin

public double getMin()
Get the minimum of the values.

Returns:
The minimum

getMax

public double getMax()
Get the maximum of the values.

Returns:
The maximum