|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpapaya.Descriptive.Sum
public static class Descriptive.Sum
Methods for computing various different sums of datasets such as sum of inversions, logs, products, power deviations, squares, etc.
Method Summary | |
---|---|
static double |
inversions(float[] data,
int from,
int to)
Returns the sum of inversions of a data sequence, which is Sum( 1.0 / data[i]) . |
static double |
logs(float[] data,
int from,
int to)
Returns the sum of logarithms of a data sequence, which is Sum( Log(data[i]) . |
static double |
powerDeviations(float[] data,
int k,
float c)
Returns Sum( (data[i]-c)k ) ;
optimized for common parameters like c == 0.0 and/or k == -2 .. |
static double |
powerDeviations(float[] data,
int k,
float c,
int from,
int to)
Returns Sum( (data[i]-c)k ) for all i = from .. |
static double |
powers(float[] data,
int k)
Returns the sum of powers of a data sequence, which is Sum ( data[i]k ) . |
static double |
products(float[] data1,
float[] data2)
Returns the sum of the product of two data arrays, Sum( x[i] * y[i]) . |
static float |
squaredDeviations(int size,
float variance)
Returns the sum of squared mean deviation of of a data sequence. |
static double |
squares(float[] data)
Returns the sum of squares of a data sequence. |
static float |
sum(float[] data)
Returns the simple sum of a data sequence. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double inversions(float[] data, int from, int to)
Sum( 1.0 / data[i])
.
data
- the data sequence.from
- the index of the first data element (inclusive).to
- the index of the last data element (inclusive).public static double logs(float[] data, int from, int to)
Sum( Log(data[i])
.
data
- the data sequence.from
- the index of the first data element (inclusive).to
- the index of the last data element (inclusive).public static double products(float[] data1, float[] data2)
Sum( x[i] * y[i])
.
data1
- the first data sequence.data2
- the second data sequence
public static double powerDeviations(float[] data, int k, float c)
Sum( (data[i]-c)k )
;
optimized for common parameters like c == 0.0
and/or k == -2 .. 4
.
public static double powerDeviations(float[] data, int k, float c, int from, int to)
Sum( (data[i]-c)k )
for all i = from .. to
;
optimized for common parameters like c == 0.0
and/or k == -2 .. 5
.
Note that no checks are made for divisions by zero (important for
k = -2
and k = -1
), so think twice before using this
if the data has elements = 0.
public static double powers(float[] data, int k)
Sum ( data[i]k )
.
public static float squaredDeviations(int size, float variance)
variance * (size-1) == Sum( (data[i] - mean)^2 )
.
size
- the number of elements of the data sequence.variance
- the variance of the data sequence.public static double squares(float[] data)
Sum ( data[i]*data[i] )
.
public static float sum(float[] data)
Sum( data[i] )
.
Mat.sum(float[])
,
Mat.sum(float[], float[])
,
Mat.sum(float[],float)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |