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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.correlation.SquaredPearsonCorrelationDistanceFunction
All Implemented Interfaces:
DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable

public class SquaredPearsonCorrelationDistanceFunction
extends AbstractVectorDoubleDistanceFunction

Squared Pearson correlation distance function for feature vectors. The squared Pearson correlation distance is computed from the Pearson correlation coefficient r as: 1-r 2. 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).


Nested Class Summary
static class SquaredPearsonCorrelationDistanceFunction.Parameterizer
          Parameterization class.
 
Field Summary
static SquaredPearsonCorrelationDistanceFunction STATIC
          Static instance.
 
Constructor Summary
SquaredPearsonCorrelationDistanceFunction()
          Deprecated. use static instance!
 
Method Summary
 double doubleDistance(NumberVector<?,?> v1, NumberVector<?,?> v2)
          Computes the squared Pearson correlation distance for two given feature vectors.
 boolean equals(Object obj)
           
 String toString()
           
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
distance, getDistanceFactory, getInputTypeRestriction
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction
instantiate, isMetric, isSymmetric
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
instantiate, isMetric, isSymmetric
 

Field Detail

STATIC

public static final SquaredPearsonCorrelationDistanceFunction STATIC
Static instance.

Constructor Detail

SquaredPearsonCorrelationDistanceFunction

@Deprecated
public SquaredPearsonCorrelationDistanceFunction()
Deprecated. use static instance!

Provides a SquaredPearsonCorrelationDistanceFunction.

Method Detail

doubleDistance

public double doubleDistance(NumberVector<?,?> v1,
                             NumberVector<?,?> 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-r 2. Hence, possible values of this distance are between 0 and 1.

Parameters:
v1 - first feature vector
v2 - second feature vector
Returns:
the squared Pearson correlation distance for two given feature vectors v1 and v2

toString

public String toString()
Overrides:
toString in class Object

equals

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

Release 0.4.0 (2011-09-20_1324)