|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.liv.util.CummulativeDistribution
A utility class for cummulative tracking of stats for a series of doubles. Moments are incremented dynamically, rather than keeping the actual cases in memory.
Example usage:
CummulativeStatCounter series1 = new CummulativeStatCounter("series1");
series1.newData(4.5);
series1.newData(5.6);
series1.newData(9.0);
System.out.println("Standard deviation of series1 = " + series1.getStdDev());
series1.newData(5.56);
series1.newData(12);
System.out.println("And now the standard deviation = " + series1.getStdDev());
| Field Summary | |
protected double |
max
The maximum so far. |
protected double |
min
The minimum so far. |
protected int |
n
The number of data in the series so far. |
protected double |
total
The cummulative total of all numbers in the series so far. |
protected double |
totalSq
The square of the total. |
protected java.lang.String |
varName
The name of this series. |
| Constructor Summary | |
CummulativeDistribution()
|
|
CummulativeDistribution(java.lang.String varName)
|
|
| Method Summary | |
java.lang.Object |
clone()
|
double |
getMax()
Get the maximum datum. |
double |
getMean()
Get the mean of the data. |
double |
getMin()
Get the minimum datum. |
int |
getN()
Get the number of items in the series. |
java.lang.String |
getName()
|
double |
getStdDev()
Get the standard deviation from the mean. |
double |
getStdDev(double origin)
Get the standard deviation of the data about origin. |
double |
getTotal()
Get the total of the data |
double |
getTrimmedMean(double p)
|
double |
getVarCoef(double origin)
Get the coefficient of variable about origin. |
double |
getVariance()
Get the variance about the mean. |
double |
getVariance(double origin)
Get the variance of the data about origin. |
void |
initialise()
|
void |
log()
|
void |
newData(double i)
Add a new datum to the series. |
void |
reset()
Reinitialise our state to the original settings. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int n
protected double total
protected double totalSq
protected double min
protected double max
protected java.lang.String varName
| Constructor Detail |
public CummulativeDistribution(java.lang.String varName)
public CummulativeDistribution()
| Method Detail |
public void initialise()
public void newData(double i)
newData in interface Distributionpublic int getN()
getN in interface Distributionpublic double getMean()
getMean in interface Distributionpublic double getVariance(double origin)
getVariance in interface Distributionpublic double getStdDev(double origin)
getStdDev in interface Distributionpublic double getVariance()
getVariance in interface Distributionpublic double getStdDev()
getStdDev in interface Distributionpublic double getVarCoef(double origin)
getVarCoef in interface Distributionpublic double getMin()
getMin in interface Distributionpublic double getMax()
getMax in interface Distributionpublic double getTotal()
getTotal in interface Distribution
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedExceptionpublic void reset()
Resetable
reset in interface Resetablepublic java.lang.String getName()
getName in interface Distributionpublic java.lang.String toString()
public void log()
log in interface Distributionpublic double getTrimmedMean(double p)
getTrimmedMean in interface Distribution
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||