Package elki.distance.correlation
Class UncenteredCorrelationDistance
- java.lang.Object
-
- elki.distance.AbstractNumberVectorDistance
-
- elki.distance.correlation.UncenteredCorrelationDistance
-
- All Implemented Interfaces:
Distance<NumberVector>
,NumberVectorDistance<NumberVector>
,PrimitiveDistance<NumberVector>
public class UncenteredCorrelationDistance extends AbstractNumberVectorDistance
Uncentered correlation distance. This is highly similar toPearsonCorrelationDistance
, but uses a fixed mean of 0 instead of the sample mean.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UncenteredCorrelationDistance.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description static UncenteredCorrelationDistance
STATIC
Static instance.
-
Constructor Summary
Constructors Constructor Description UncenteredCorrelationDistance()
Deprecated.Use static instance!
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(NumberVector v1, NumberVector v2)
Computes the Pearson correlation distance for two given feature vectors.boolean
equals(java.lang.Object obj)
int
hashCode()
java.lang.String
toString()
static double
uncenteredCorrelation(double[] x, double[] y)
Compute the uncentered correlation of two vectors.static double
uncenteredCorrelation(NumberVector x, NumberVector y)
Compute the uncentered correlation of two vectors.-
Methods inherited from class elki.distance.AbstractNumberVectorDistance
dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, getInputTypeRestriction
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isMetric, isSquared, isSymmetric
-
Methods inherited from interface elki.distance.PrimitiveDistance
instantiate
-
-
-
-
Field Detail
-
STATIC
public static final UncenteredCorrelationDistance STATIC
Static instance.
-
-
Constructor Detail
-
UncenteredCorrelationDistance
@Deprecated public UncenteredCorrelationDistance()
Deprecated.Use static instance!Constructor - useSTATIC
instead.
-
-
Method Detail
-
uncenteredCorrelation
public static double uncenteredCorrelation(NumberVector x, NumberVector y)
Compute the uncentered correlation of two vectors.- Parameters:
x
- first NumberVectory
- second NumberVector- Returns:
- the uncentered correlation coefficient for x and y
-
uncenteredCorrelation
public static double uncenteredCorrelation(double[] x, double[] y)
Compute the uncentered correlation of two vectors.- Parameters:
x
- first NumberVectory
- second NumberVector- Returns:
- the uncentered correlation coefficient for x and y
-
distance
public double distance(NumberVector v1, NumberVector v2)
Computes the Pearson correlation distance for two given feature vectors. The Pearson correlation distance is computed from the Pearson correlation coefficientr
as:1-r
. Hence, possible values of this distance are between 0 and 2.- Parameters:
v1
- first feature vectorv2
- second feature vector- Returns:
- the Pearson correlation distance for two given feature vectors v1 and v2
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-