public class MightyStaticFloatBin1D extends StaticFloatBin1D
Constructor and Description |
---|
MightyStaticFloatBin1D()
Constructs and returns an empty bin with limited functionality but good
performance; equivalent to MightyStaticBin1D(false,false,4).
|
MightyStaticFloatBin1D(boolean hasSumOfLogarithms,
boolean hasSumOfInversions,
int maxOrderForSumOfPowers)
Constructs and returns an empty bin with the given capabilities.
|
Modifier and Type | Method and Description |
---|---|
void |
addAllOfFromTo(FloatArrayList 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(AbstractFloatBin1D other)
Computes the deviations from the receiver's measures to another bin's
measures.
|
float |
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.
|
float |
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.
|
float |
kurtosis()
Returns the kurtosis (aka excess), which is
-3 + moment(4,mean()) / standardDeviation()4.
|
float |
moment(int k,
float c)
Returns the moment of k-th order with value c, which is
Sum( (x[i]-c)k ) / size().
|
float |
product()
Returns the product, which is Prod( x[i] ).
|
float |
skew()
Returns the skew, which is
moment(3,mean()) / standardDeviation()3.
|
float |
sumOfInversions()
Returns the sum of inversions, which is Sum( 1 / x[i] ).
|
float |
sumOfLogarithms()
Returns the sum of logarithms, which is Sum( Log(x[i]) ).
|
float |
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 MightyStaticFloatBin1D()
public MightyStaticFloatBin1D(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,float)
public void addAllOfFromTo(FloatArrayList list, int from, int to)
addAllOfFromTo
in class StaticFloatBin1D
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(AbstractFloatBin1D other)
compareWith
in class AbstractFloatBin1D
other
- the other bin to compare withpublic float geometricMean()
public int getMaxOrderForSumOfPowers()
hasSumOfPowers(int)
,
sumOfPowers(int)
public int getMinOrderForSumOfPowers()
hasSumOfPowers(int)
,
sumOfPowers(int)
public float 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 float kurtosis()
hasSumOfPowers(int)
public float moment(int k, float c)
k
- the order; must be greater than or equal to zero.c
- any number.IllegalArgumentException
- if k < 0.public float product()
hasSumOfLogarithms()
public float skew()
hasSumOfPowers(int)
public float sumOfInversions()
hasSumOfInversions()
public float sumOfLogarithms()
hasSumOfLogarithms()
public float sumOfPowers(int k)
k
- the order of the powers.hasSumOfPowers(int)
public String toString()
toString
in class AbstractFloatBin1D
Jump to the Parallel Colt Homepage