public class MightyStaticBin1D extends StaticBin1D
serialVersionUID
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
add, clear, isRebinnable, max, min, size, sum, sumOfSquares
addAllOf, buffered, equals, mean, rms, standardDeviation, standardError, trimToSize, variance
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)
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 withpublic 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
Jas4pp 1.5 © Java Analysis Studio for Particle Physics