JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.alsUtility
Class WeightedStatistics

java.lang.Object
  extended bygov.nasa.alsUtility.WeightedStatistics
All Implemented Interfaces:
java.io.Serializable

public class WeightedStatistics
extends java.lang.Object
implements java.io.Serializable

holds doubles (called "datums") from a statistical sample and does simple statistics on them

See Also:
Serialized Form

Field Summary
protected  int count
           
protected  int countOfNonNormalNumbers
           
protected  double max
           
protected  double min
           
protected  double sum
           
protected  double sumSquares
           
protected  double weightSum
           
 
Constructor Summary
WeightedStatistics()
           
 
Method Summary
 void addData(double[] values)
           
 void addData(double[] values, double[] weights)
           
 void addDatum(double value)
          add datum d to the sample
 void addDatum(double value, double weight)
           
 int getBadNumberCount()
           
 double getMax()
          of values with non-zero weight
 double getMean()
           
 double getMin()
          of values with non-zero weight
 int getN()
           
 double getRMS()
           
 double getSpread()
           
 double getSumOfWeights()
           
 double getWeightedSum()
           
 java.lang.String statisticsString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sum

protected double sum

sumSquares

protected double sumSquares

weightSum

protected double weightSum

count

protected int count

countOfNonNormalNumbers

protected int countOfNonNormalNumbers

min

protected double min

max

protected double max
Constructor Detail

WeightedStatistics

public WeightedStatistics()
Method Detail

addDatum

public void addDatum(double value)
add datum d to the sample


addDatum

public void addDatum(double value,
                     double weight)

addData

public void addData(double[] values)

addData

public void addData(double[] values,
                    double[] weights)

statisticsString

public java.lang.String statisticsString()
Returns:
statistics in tab separated format

getWeightedSum

public double getWeightedSum()

getSumOfWeights

public double getSumOfWeights()

getMean

public double getMean()

getMin

public double getMin()
of values with non-zero weight


getMax

public double getMax()
of values with non-zero weight


getSpread

public double getSpread()

getRMS

public double getRMS()

getN

public int getN()
Returns:
number of entries with non-zero weight

getBadNumberCount

public int getBadNumberCount()

JavaGenes, NASA Ames. Written largely by Al Globus