de.lmu.ifi.dbs.elki.distance.distancefunction.correlation
Class ERiCDistanceFunction

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDatabaseDistanceFunction<O,D>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction<NumberVector<?,?>,FilteredLocalPCAIndex<NumberVector<?,?>>,BitDistance>
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.ERiCDistanceFunction
All Implemented Interfaces:
DistanceFunction<NumberVector<?,?>,BitDistance>, FilteredLocalPCABasedDistanceFunction<NumberVector<?,?>,FilteredLocalPCAIndex<NumberVector<?,?>>,BitDistance>, IndexBasedDistanceFunction<NumberVector<?,?>,BitDistance>, InspectionUtilFrequentlyScanned, Parameterizable

public class ERiCDistanceFunction
extends AbstractIndexBasedDistanceFunction<NumberVector<?,?>,FilteredLocalPCAIndex<NumberVector<?,?>>,BitDistance>
implements FilteredLocalPCABasedDistanceFunction<NumberVector<?,?>,FilteredLocalPCAIndex<NumberVector<?,?>>,BitDistance>

Provides a distance function for building the hierarchy in the ERiC algorithm.


Nested Class Summary
static class ERiCDistanceFunction.Instance<V extends NumberVector<?,?>>
          The actual instance bound to a particular database.
static class ERiCDistanceFunction.Parameterizer
          Parameterization class.
 
Field Summary
private  double delta
          Holds the value of DELTA_ID.
static OptionID DELTA_ID
          Parameter to specify the threshold for approximate linear dependency: the strong eigenvectors of q are approximately linear dependent from the strong eigenvectors p if the following condition holds for all strong eigenvectors q_i of q (lambda_q < lambda_p): q_i' * M^check_p * q_i <= delta^2, must be a double equal to or greater than 0.
(package private) static Logging logger
          Logger for debug.
private  double tau
          Holds the value of TAU_ID.
static OptionID TAU_ID
          Parameter to specify the threshold for the maximum distance between two approximately linear dependent subspaces of two objects p and q (lambda_q < lambda_p) before considering them as parallel, must be a double equal to or greater than 0.
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction
indexFactory
 
Fields inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.IndexBasedDistanceFunction
INDEX_ID
 
Constructor Summary
ERiCDistanceFunction(IndexFactory<NumberVector<?,?>,FilteredLocalPCAIndex<NumberVector<?,?>>> indexFactory, double delta, double tau)
          Constructor.
 
Method Summary
private  boolean approximatelyLinearDependent(PCAFilteredResult pca1, PCAFilteredResult pca2)
          Returns true, if the strong eigenvectors of the two specified pcas span up the same space.
 BitDistance distance(NumberVector<?,?> v1, NumberVector<?,?> v2, PCAFilteredResult pca1, PCAFilteredResult pca2)
          Computes the distance between two given DatabaseObjects according to this distance function.
 boolean equals(Object obj)
           
 BitDistance getDistanceFactory()
          Method to get the distance functions factory.
<T extends NumberVector<?,?>>
ERiCDistanceFunction.Instance<T>
instantiate(Relation<T> database)
          Instantiate with a database to get the actual distance query.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction
getInputTypeRestriction, isMetric, isSymmetric
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
getInputTypeRestriction, isMetric, isSymmetric
 

Field Detail

logger

static Logging logger
Logger for debug.


DELTA_ID

public static final OptionID DELTA_ID
Parameter to specify the threshold for approximate linear dependency: the strong eigenvectors of q are approximately linear dependent from the strong eigenvectors p if the following condition holds for all strong eigenvectors q_i of q (lambda_q < lambda_p): q_i' * M^check_p * q_i <= delta^2, must be a double equal to or greater than 0.

Default value: 0.1

Key: -ericdf.delta


TAU_ID

public static final OptionID TAU_ID
Parameter to specify the threshold for the maximum distance between two approximately linear dependent subspaces of two objects p and q (lambda_q < lambda_p) before considering them as parallel, must be a double equal to or greater than 0.

Default value: 0.1

Key: -ericdf.tau


delta

private double delta
Holds the value of DELTA_ID.


tau

private double tau
Holds the value of TAU_ID.

Constructor Detail

ERiCDistanceFunction

public ERiCDistanceFunction(IndexFactory<NumberVector<?,?>,FilteredLocalPCAIndex<NumberVector<?,?>>> indexFactory,
                            double delta,
                            double tau)
Constructor.

Parameters:
indexFactory - Index factory.
delta - Delta parameter
tau - Tau parameter
Method Detail

getDistanceFactory

public BitDistance getDistanceFactory()
Description copied from interface: DistanceFunction
Method to get the distance functions factory.

Specified by:
getDistanceFactory in interface DistanceFunction<NumberVector<?,?>,BitDistance>
Specified by:
getDistanceFactory in class AbstractDatabaseDistanceFunction<NumberVector<?,?>,BitDistance>
Returns:
Factory for distance objects

instantiate

public <T extends NumberVector<?,?>> ERiCDistanceFunction.Instance<T> instantiate(Relation<T> database)
Description copied from interface: FilteredLocalPCABasedDistanceFunction
Instantiate with a database to get the actual distance query.

Specified by:
instantiate in interface DistanceFunction<NumberVector<?,?>,BitDistance>
Specified by:
instantiate in interface FilteredLocalPCABasedDistanceFunction<NumberVector<?,?>,FilteredLocalPCAIndex<NumberVector<?,?>>,BitDistance>
Parameters:
database - The representation to use
Returns:
Actual distance query.

approximatelyLinearDependent

private boolean approximatelyLinearDependent(PCAFilteredResult pca1,
                                             PCAFilteredResult pca2)
Returns true, if the strong eigenvectors of the two specified pcas span up the same space. Note, that the first pca must have equal ore more strong eigenvectors than the second pca.

Parameters:
pca1 - first PCA
pca2 - second PCA
Returns:
true, if the strong eigenvectors of the two specified pcas span up the same space

distance

public BitDistance distance(NumberVector<?,?> v1,
                            NumberVector<?,?> v2,
                            PCAFilteredResult pca1,
                            PCAFilteredResult pca2)
Computes the distance between two given DatabaseObjects according to this distance function. Note, that the first pca must have equal or more strong eigenvectors than the second pca.

Parameters:
v1 - first DatabaseObject
v2 - second DatabaseObject
pca1 - first PCA
pca2 - second PCA
Returns:
the distance between two given DatabaseObjects according to this distance function

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Release 0.4.0 (2011-09-20_1324)