|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.hogent.tarsos.util.KernelDensityEstimate
public class KernelDensityEstimate
Nested Class Summary | |
---|---|
static class |
KernelDensityEstimate.Cosine
|
static class |
KernelDensityEstimate.GaussianKernel
A Gaussian kernel function. |
static interface |
KernelDensityEstimate.KDECorrelation
|
static interface |
KernelDensityEstimate.Kernel
Defines a kernel. |
static class |
KernelDensityEstimate.Overlap
|
static class |
KernelDensityEstimate.RectangularKernel
A rectangular kernel function. |
Field Summary | |
---|---|
protected double[] |
accumulator
|
protected KernelDensityEstimate.Kernel |
kernel
|
Constructor Summary | |
---|---|
KernelDensityEstimate(KernelDensityEstimate.Kernel kernel,
double[] accumulator)
|
|
KernelDensityEstimate(KernelDensityEstimate.Kernel kernel,
int size)
|
Method Summary | |
---|---|
void |
add(double value)
Add the kernel to an accumulator for each value. |
void |
add(KernelDensityEstimate other)
Adds a KDE to this accumulator |
void |
clear()
Clears the data in the accumulator. |
double |
correlation(KernelDensityEstimate other,
int positionsToShiftOther)
Calculate a correlation with another KernelDensityEstimate. |
double[] |
getEstimate()
Returns the current estimate. |
double |
getMaxElement()
|
double |
getSumFreq()
Returns the sum of all estimates in the accumulator. |
double |
getValue(int index)
Return the value for the accumulator at a certain index. |
KernelDensityEstimate |
map(int size)
Map the kernel density estimate to another size. |
void |
max(KernelDensityEstimate other)
Takes the maximum of the value in the accumulator for two kde's. |
void |
normalize()
Sets the maximum value in accumulator to 1.0 |
double |
optimalCorrelation(KernelDensityEstimate.KDECorrelation correlationMeasure,
KernelDensityEstimate other)
Calculates the optimal correlation between two Kernel Density Estimates by shifting and searching for optimal correlation. |
double |
optimalCorrelation(KernelDensityEstimate other)
Calculates the optimal correlation between two Kernel Density Estimates by shifting and searching for optimal correlation. |
void |
pdfify()
Sets the area under the curve to 1.0. |
void |
remove(double value)
Remove a value from the kde, removes a kernel at the specified position. |
void |
shift(int shift)
Shift the accumulator x positions. |
int |
shiftForOptimalCorrelation(KernelDensityEstimate.KDECorrelation correlationMeasure,
KernelDensityEstimate other)
Calculates how much the other KernelDensityEstimate needs to be shifted for optimal correlation. |
int |
shiftForOptimalCorrelation(KernelDensityEstimate other)
Calculates how much the other KernelDensityEstimate needs to be shifted for optimal correlation. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final double[] accumulator
protected final KernelDensityEstimate.Kernel kernel
Constructor Detail |
---|
public KernelDensityEstimate(KernelDensityEstimate.Kernel kernel, int size)
public KernelDensityEstimate(KernelDensityEstimate.Kernel kernel, double[] accumulator)
Method Detail |
---|
public void add(double value)
value
- The value to add.public void remove(double value)
value
- The value to remove.public void shift(int shift)
shift
- The number of positions the accumulator should be shifted.public double[] getEstimate()
public KernelDensityEstimate map(int size)
(1 2 4 9).map(2) = (5 11)
size
- The new size for the KDE.
public double getValue(int index)
index
- The index.
public int size()
public double getSumFreq()
public void normalize()
public double getMaxElement()
public void pdfify()
public void clear()
public void max(KernelDensityEstimate other)
other
- The other kde of the same size.public void add(KernelDensityEstimate other)
other
- The other KDE of the same size.public double correlation(KernelDensityEstimate other, int positionsToShiftOther)
Calculate a correlation with another KernelDensityEstimate. The index of the other estimates are shifted by a number which can be zero (or positive or negative). Beware: the index wraps around the edges.
This and the other KernelDensityEstimate should have the same size.
other
- The other estimate.positionsToShiftOther
- The number of positions to shift the estimate.
public int shiftForOptimalCorrelation(KernelDensityEstimate other)
other
- The other KernelDensityEstimate.
public double optimalCorrelation(KernelDensityEstimate other)
other
- The other KernelDensityEstimate.
public double optimalCorrelation(KernelDensityEstimate.KDECorrelation correlationMeasure, KernelDensityEstimate other)
correlationMeasure
- other
- The other KernelDensityEstimate.
public int shiftForOptimalCorrelation(KernelDensityEstimate.KDECorrelation correlationMeasure, KernelDensityEstimate other)
correlationMeasure
- other
- The other KernelDensityEstimate.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |