|
||||||||||
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.GaussianKernel
A Gaussian kernel function. |
static interface |
KernelDensityEstimate.Kernel
Defines a kernel. |
static class |
KernelDensityEstimate.RectangularKernel
A rectangular kernel function. |
Constructor Summary | |
---|---|
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 |
double |
correlation(KernelDensityEstimate other,
int positionsToShiftOther)
Calculate a correlation with another KernelDensityEstimate. |
double[] |
getEstimate()
Returns the current estimate. |
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. |
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 |
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 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 |
Constructor Detail |
---|
public KernelDensityEstimate(KernelDensityEstimate.Kernel kernel, int size)
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 double getValue(int index)
index
- The index.
public int size()
public double getSumFreq()
public void normalize()
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |