de.lmu.ifi.dbs.elki.distance.distancefunction.correlation
Class PCABasedCorrelationDistanceFunction.Instance<V extends NumberVector<?,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery<O>
      extended by de.lmu.ifi.dbs.elki.database.query.distance.AbstractDistanceQuery<O,D>
          extended by de.lmu.ifi.dbs.elki.database.query.distance.AbstractDatabaseDistanceQuery<O,D>
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction.Instance<V,FilteredLocalPCAIndex<V>,PCACorrelationDistance,PCABasedCorrelationDistanceFunction>
                  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.PCABasedCorrelationDistanceFunction.Instance<V>
All Implemented Interfaces:
DatabaseQuery, DistanceQuery<V,PCACorrelationDistance>, FilteredLocalPCABasedDistanceFunction.Instance<V,FilteredLocalPCAIndex<V>,PCACorrelationDistance>, IndexBasedDistanceFunction.Instance<V,FilteredLocalPCAIndex<V>,PCACorrelationDistance>
Enclosing class:
PCABasedCorrelationDistanceFunction

public static class PCABasedCorrelationDistanceFunction.Instance<V extends NumberVector<?,?>>
extends AbstractIndexBasedDistanceFunction.Instance<V,FilteredLocalPCAIndex<V>,PCACorrelationDistance,PCABasedCorrelationDistanceFunction>
implements FilteredLocalPCABasedDistanceFunction.Instance<V,FilteredLocalPCAIndex<V>,PCACorrelationDistance>

The actual instance bound to a particular database.


Field Summary
(package private)  double delta
          Delta value
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction.Instance
index, parent
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
relation
 
Fields inherited from interface de.lmu.ifi.dbs.elki.database.query.DatabaseQuery
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
 
Constructor Summary
PCABasedCorrelationDistanceFunction.Instance(Relation<V> database, FilteredLocalPCAIndex<V> index, double delta, PCABasedCorrelationDistanceFunction distanceFunction)
          Constructor.
 
Method Summary
private  void adjust(Matrix v, Matrix e_czech, Matrix vector, int corrDim)
          Inserts the specified vector into the given orthonormal matrix v at column corrDim.
 int correlationDistance(PCAFilteredResult pca1, PCAFilteredResult pca2, int dimensionality)
          Computes the correlation distance between the two subspaces defined by the specified PCAs.
 PCACorrelationDistance distance(DBID id1, DBID id2)
          Returns the distance between the two objects specified by their object ids.
private  double euclideanDistance(V dv1, V dv2)
          Computes the Euclidean distance between the given two vectors.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction.Instance
getDistanceFunction, getIndex
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.distance.AbstractDatabaseDistanceQuery
distance, distance, distance
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.distance.AbstractDistanceQuery
getDistanceFactory, infiniteDistance, nullDistance, undefinedDistance
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
getRelation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.IndexBasedDistanceFunction.Instance
getIndex
 
Methods inherited from interface de.lmu.ifi.dbs.elki.database.query.distance.DistanceQuery
distance, distance, distance, getDistanceFactory, getDistanceFunction, getRelation, infiniteDistance, nullDistance, undefinedDistance
 

Field Detail

delta

final double delta
Delta value

Constructor Detail

PCABasedCorrelationDistanceFunction.Instance

public PCABasedCorrelationDistanceFunction.Instance(Relation<V> database,
                                                    FilteredLocalPCAIndex<V> index,
                                                    double delta,
                                                    PCABasedCorrelationDistanceFunction distanceFunction)
Constructor.

Parameters:
database - Database
index - Index to use
delta - Delta
distanceFunction - Distance function
Method Detail

distance

public PCACorrelationDistance distance(DBID id1,
                                       DBID id2)
Description copied from class: AbstractDistanceQuery
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DistanceQuery<V extends NumberVector<?,?>,PCACorrelationDistance>
Specified by:
distance in class AbstractDistanceQuery<V extends NumberVector<?,?>,PCACorrelationDistance>
Parameters:
id1 - first object id
id2 - second object id
Returns:
the distance between the two objects specified by their object ids

correlationDistance

public int correlationDistance(PCAFilteredResult pca1,
                               PCAFilteredResult pca2,
                               int dimensionality)
Computes the correlation distance between the two subspaces defined by the specified PCAs.

Parameters:
pca1 - first PCA
pca2 - second PCA
dimensionality - the dimensionality of the data space
Returns:
the correlation distance between the two subspaces defined by the specified PCAs

adjust

private void adjust(Matrix v,
                    Matrix e_czech,
                    Matrix vector,
                    int corrDim)
Inserts the specified vector into the given orthonormal matrix v at column corrDim. After insertion the matrix v is orthonormalized and column corrDim of matrix e_czech is set to the corrDim-th unit vector.

Parameters:
v - the orthonormal matrix of the eigenvectors
e_czech - the selection matrix of the strong eigenvectors
vector - the vector to be inserted
corrDim - the column at which the vector should be inserted

euclideanDistance

private double euclideanDistance(V dv1,
                                 V dv2)
Computes the Euclidean distance between the given two vectors.

Parameters:
dv1 - first FeatureVector
dv2 - second FeatureVector
Returns:
the Euclidean distance between the given two vectors

Release 0.4.0 (2011-09-20_1324)