uk.ac.liv.util
Class HeavyweightDistribution

java.lang.Object
  extended byuk.ac.liv.util.CummulativeDistribution
      extended byuk.ac.liv.util.HeavyweightDistribution
All Implemented Interfaces:
java.lang.Cloneable, Distribution, Resetable, java.io.Serializable

public class HeavyweightDistribution
extends CummulativeDistribution

An distribution which keeps actual cases in memory as well as updating moments dynamically. This implementation of a Distribution is capable of calculating trimmed means. Note that calculating the trimmed mean results in a sorting operation, and hence is not as efficient as calculating the untrimmed mean.

Version:
$Revision: 1.6 $
Author:
Steve Phelps
See Also:
Serialized Form

Field Summary
protected  gnu.trove.TDoubleArrayList data
           
protected  boolean hasChanged
           
protected  double trimmedMean
           
 
Fields inherited from class uk.ac.liv.util.CummulativeDistribution
max, min, n, total, totalSq, varName
 
Constructor Summary
HeavyweightDistribution(java.lang.String name)
           
 
Method Summary
 double getTrimmedMean(double p)
           
 void initialise()
           
 void newData(double datum)
          Add a new datum to the series.
 
Methods inherited from class uk.ac.liv.util.CummulativeDistribution
clone, getMax, getMean, getMin, getN, getName, getStdDev, getStdDev, getTotal, getVarCoef, getVariance, getVariance, log, reset, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected gnu.trove.TDoubleArrayList data

trimmedMean

protected double trimmedMean

hasChanged

protected boolean hasChanged
Constructor Detail

HeavyweightDistribution

public HeavyweightDistribution(java.lang.String name)
Method Detail

initialise

public void initialise()
Overrides:
initialise in class CummulativeDistribution

newData

public void newData(double datum)
Description copied from class: CummulativeDistribution
Add a new datum to the series.

Specified by:
newData in interface Distribution
Overrides:
newData in class CummulativeDistribution

getTrimmedMean

public double getTrimmedMean(double p)
Specified by:
getTrimmedMean in interface Distribution
Overrides:
getTrimmedMean in class CummulativeDistribution