|
Colt 1.2.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cern.colt.PersistentObject hep.aida.bin.AbstractBin hep.aida.bin.AbstractBin1D hep.aida.bin.StaticBin1D hep.aida.bin.MightyStaticBin1D
Static and the same as its superclass, except that it can do more: Additionally computes moments of arbitrary integer order, harmonic mean, geometric mean, etc. Constructors need to be told what functionality is required for the given use case. Only maintains aggregate measures (incrementally) - the added elements themselves are not kept.
Field Summary |
Fields inherited from class cern.colt.PersistentObject |
serialVersionUID |
Constructor Summary | |
MightyStaticBin1D()
Constructs and returns an empty bin with limited functionality but good performance; equivalent to MightyStaticBin1D(false,false,4). |
|
MightyStaticBin1D(boolean hasSumOfLogarithms,
boolean hasSumOfInversions,
int maxOrderForSumOfPowers)
Constructs and returns an empty bin with the given capabilities. |
Method Summary | |
void |
addAllOfFromTo(DoubleArrayList list,
int from,
int to)
Adds the part of the specified list between indexes from (inclusive) and to (inclusive) to the receiver. |
Object |
clone()
Returns a deep copy of the receiver. |
String |
compareWith(AbstractBin1D other)
Computes the deviations from the receiver's measures to another bin's measures. |
double |
geometricMean()
Returns the geometric mean, which is Product( x[i] )1.0/size(). |
int |
getMaxOrderForSumOfPowers()
Returns the maximum order k for which sums of powers are retrievable, as specified upon instance construction. |
int |
getMinOrderForSumOfPowers()
Returns the minimum order k for which sums of powers are retrievable, as specified upon instance construction. |
double |
harmonicMean()
Returns the harmonic mean, which is size() / Sum( 1/x[i] ). |
boolean |
hasSumOfInversions()
Returns whether sumOfInversions() can return meaningful results. |
boolean |
hasSumOfLogarithms()
Tells whether sumOfLogarithms() can return meaningful results. |
boolean |
hasSumOfPowers(int k)
Tells whether sumOfPowers(k) can return meaningful results. |
double |
kurtosis()
Returns the kurtosis (aka excess), which is -3 + moment(4,mean()) / standardDeviation()4. |
double |
moment(int k,
double c)
Returns the moment of k-th order with value c, which is Sum( (x[i]-c)k ) / size(). |
double |
product()
Returns the product, which is Prod( x[i] ). |
double |
skew()
Returns the skew, which is moment(3,mean()) / standardDeviation()3. |
double |
sumOfInversions()
Returns the sum of inversions, which is Sum( 1 / x[i] ). |
double |
sumOfLogarithms()
Returns the sum of logarithms, which is Sum( Log(x[i]) ). |
double |
sumOfPowers(int k)
Returns the k-th order sum of powers, which is Sum( x[i]k ). |
String |
toString()
Returns a String representation of the receiver. |
Methods inherited from class hep.aida.bin.StaticBin1D |
add, clear, isRebinnable, max, min, size, sum, sumOfSquares |
Methods inherited from class hep.aida.bin.AbstractBin1D |
addAllOf, buffered, equals, mean, rms, standardDeviation, standardError, trimToSize, variance |
Methods inherited from class hep.aida.bin.AbstractBin |
center, center, error, error, offset, offset, value, value |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MightyStaticBin1D()
public MightyStaticBin1D(boolean hasSumOfLogarithms, boolean hasSumOfInversions, int maxOrderForSumOfPowers)
hasSumOfLogarithms
- Tells whether sumOfLogarithms()
can return meaningful results.
Set this parameter to false if measures of sum of logarithms, geometric mean and product are not required.
hasSumOfInversions
- Tells whether sumOfInversions()
can return meaningful results.
Set this parameter to false if measures of sum of inversions, harmonic mean and sumOfPowers(-1) are not required.
maxOrderForSumOfPowers
- The maximum order k for which sumOfPowers(int)
can return meaningful results.
Set this parameter to at least 3 if the skew is required, to at least 4 if the kurtosis is required.
In general, if moments are required set this parameter at least as large as the largest required moment.
This method always substitutes Math.max(2,maxOrderForSumOfPowers) for the parameter passed in.
Thus, sumOfPowers(0..2) always returns meaningful results.hasSumOfPowers(int)
,
moment(int,double)
Method Detail |
public void addAllOfFromTo(DoubleArrayList list, int from, int to)
addAllOfFromTo
in class StaticBin1D
list
- the list of which elements shall be added.from
- the index of the first element to be added (inclusive).to
- the index of the last element to be added (inclusive).
IndexOutOfBoundsException
- if list.size()>0 && (from<0 || from>to || to>=list.size()).public Object clone()
clone
in class PersistentObject
public String compareWith(AbstractBin1D other)
compareWith
in class AbstractBin1D
other
- the other bin to compare with
public double geometricMean()
public int getMaxOrderForSumOfPowers()
hasSumOfPowers(int)
,
sumOfPowers(int)
public int getMinOrderForSumOfPowers()
hasSumOfPowers(int)
,
sumOfPowers(int)
public double harmonicMean()
hasSumOfInversions()
public boolean hasSumOfInversions()
public boolean hasSumOfLogarithms()
public boolean hasSumOfPowers(int k)
Details: hasSumOfPowers(0..2) will always yield true. hasSumOfPowers(-1) <==> hasSumOfInversions().
getMinOrderForSumOfPowers()
,
getMaxOrderForSumOfPowers()
public double kurtosis()
hasSumOfPowers(int)
public double moment(int k, double c)
k
- the order; must be greater than or equal to zero.c
- any number.
IllegalArgumentException
- if k < 0.public double product()
hasSumOfLogarithms()
public double skew()
hasSumOfPowers(int)
public double sumOfInversions()
hasSumOfInversions()
public double sumOfLogarithms()
hasSumOfLogarithms()
public double sumOfPowers(int k)
k
- the order of the powers.
hasSumOfPowers(int)
public String toString()
toString
in class AbstractBin1D
|
Colt 1.2.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |