peersim.util
Class MomentStats

java.lang.Object
  extended by peersim.util.IncrementalStats
      extended by peersim.util.MomentStats

public class MomentStats
extends IncrementalStats

This class provides extended statistical informations about the inspected distribution. In particular, it provides functions to compute the skewness (the 3rd degree moment) and the kurtosis (4th degree moment).


Constructor Summary
MomentStats()
          Calls reset()
 
Method Summary
 void add(double item, int k)
          Updates the statistics assuming element item is added k times.
 double getKurtosis()
          Computes the kurtosis on the node values distribution and returns the flatness coefficient.
 double getSkewness()
          Computes the skewness on the node values distribution and returns the asymmetry coefficient.
 void reset()
          Resets the statistics to reflect the zero elements set.
 java.lang.String toString()
          Outputs on a single line the superclass statistics postfixed by the current skewness and kurtosis.
 
Methods inherited from class peersim.util.IncrementalStats
add, getAverage, getMax, getMaxCount, getMin, getMinCount, getN, getSqrSum, getStD, getSum, getVar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MomentStats

public MomentStats()
Calls reset()

Method Detail

reset

public void reset()
Description copied from class: IncrementalStats
Resets the statistics to reflect the zero elements set. Min and max are set to positive and negative infinity, respectively.

Overrides:
reset in class IncrementalStats

add

public void add(double item,
                int k)
Description copied from class: IncrementalStats
Updates the statistics assuming element item is added k times.

Overrides:
add in class IncrementalStats

toString

public java.lang.String toString()
Outputs on a single line the superclass statistics postfixed by the current skewness and kurtosis.

Overrides:
toString in class IncrementalStats

getSkewness

public double getSkewness()
Computes the skewness on the node values distribution and returns the asymmetry coefficient. It gives an indication about the distribution symmetry compared to the average.

Returns:
The skewness value as a double.

getKurtosis

public double getKurtosis()
Computes the kurtosis on the node values distribution and returns the flatness coefficient. It gives an indication about the distribution sharpness or flatness.

Returns:
The kurtosis momentus value as a double.