|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.util.IncrementalStats
public class IncrementalStats
A class that can keep track of some statistics like variance, average, min, max incrementally. That is, when adding a new data item, it updates the statistics.
Constructor Summary | |
---|---|
IncrementalStats()
Calls reset() . |
Method Summary | |
---|---|
void |
add(double item)
Updates the statistics according to this element. |
void |
add(double item,
int k)
Updates the statistics assuming element item is added
k times. |
double |
getAverage()
The average of the data items |
double |
getMax()
The maximum of the data items |
int |
getMaxCount()
Returns the number of data items whose value equals the maximum. |
double |
getMin()
The minimum of the data items |
int |
getMinCount()
Returns the number of data items whose value equals the minimum. |
int |
getN()
The number of data items processed so far |
double |
getSqrSum()
The sum of the squares of the data items |
double |
getStD()
the empirical standard deviation of the data items |
double |
getSum()
The sum of the data items |
double |
getVar()
The empirical variance of the data items. |
void |
reset()
Resets the statistics to reflect the zero elements set. |
java.lang.String |
toString()
Prints the following quantities separated by spaces in a single line in this order. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IncrementalStats()
reset()
.
Method Detail |
---|
public void reset()
public final void add(double item)
add(item,1)
.
add(double,int)
public void add(double item, int k)
item
is added
k
times.
public int getN()
public double getMax()
public double getMin()
public int getMaxCount()
public int getMinCount()
public double getSum()
public double getSqrSum()
public double getAverage()
public double getVar()
public double getStD()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |