Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction.correlation
Class SquaredPearsonCorrelationDistanceFunction<V extends NumberVector<V,N>,N extends Number>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<V,DoubleDistance>
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.SquaredPearsonCorrelationDistanceFunction<V,N>
Type Parameters:
V - the type of FeatureVector to compute the distances in between
N - the type of Number of the attributes of vectors of type V
All Implemented Interfaces:
DistanceFunction<V,DoubleDistance>, MeasurementFunction<V,DoubleDistance>, Parameterizable

public class SquaredPearsonCorrelationDistanceFunction<V extends NumberVector<V,N>,N extends Number>
extends AbstractDistanceFunction<V,DoubleDistance>
implements Parameterizable

Squared Pearson correlation distance function for feature vectors. The squared Pearson correlation distance is computed from the Pearson correlation coefficient r as: 1-r2. Hence, possible values of this distance are between 0 and 1. The distance between two vectors will be low (near 0), if their attribute values are dimension-wise strictly positively or negatively correlated. For Features with uncorrelated attributes, the distance value will be high (near 1).

Author:
Arthur Zimek

Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
distanceFactory
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
SquaredPearsonCorrelationDistanceFunction()
          Provides a SquaredPearsonCorrelationDistanceFunction.
 
Method Summary
 DoubleDistance distance(V v1, V v2)
          Computes the squared Pearson correlation distance for two given feature vectors.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction
distance, distance
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
getDatabase, getDistanceFactory, infiniteDistance, nullDistance, setDatabase, undefinedDistance, valueOf
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
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.MeasurementFunction
getDistanceFactory, infiniteDistance, nullDistance, setDatabase, undefinedDistance, valueOf
 

Constructor Detail

SquaredPearsonCorrelationDistanceFunction

public SquaredPearsonCorrelationDistanceFunction()
Provides a SquaredPearsonCorrelationDistanceFunction.

Method Detail

distance

public DoubleDistance distance(V v1,
                               V v2)
Computes the squared Pearson correlation distance for two given feature vectors. The squared Pearson correlation distance is computed from the Pearson correlation coefficient r as: 1-r2. Hence, possible values of this distance are between 0 and 1.

Specified by:
distance in interface DistanceFunction<V extends NumberVector<V,N>,DoubleDistance>
Parameters:
v1 - first feature vector
v2 - second feature vector
Returns:
the squared Pearson correlation distance for two given feature vectors v1 and v2

Release 0.3 (2010-03-31_1612)