Package elki.distance.probabilistic
Class FisherRaoDistance
- java.lang.Object
-
- elki.distance.AbstractNumberVectorDistance
-
- elki.distance.probabilistic.FisherRaoDistance
-
- All Implemented Interfaces:
Distance<NumberVector>
,NumberVectorDistance<NumberVector>
,PrimitiveDistance<NumberVector>
,SpatialPrimitiveDistance<NumberVector>
@Reference(authors="C. R. Rao",title="Information and the Accuracy Attainable in the Estimation of Statistical Parameters",booktitle="Bulletin of the Calcutta Mathematical Society 37(3)",bibkey="journals/bcalms/Rao45") @Reference(authors="M.-M. Deza, E. Deza",title="Dictionary of distances",booktitle="Dictionary of distances",url="https://doi.org/10.1007/978-3-642-00234-2",bibkey="doi:10.1007/978-3-642-00234-2") @Alias({"rao","fisher-rao","fisher"}) public class FisherRaoDistance extends AbstractNumberVectorDistance implements SpatialPrimitiveDistance<NumberVector>
Fisher-Rao riemannian metric for (discrete) probability distributions.\[ \text{Fisher-Rao}(\vec{x},\vec{y}) := 2 \arccos \sum\nolimits_i \sqrt{p_iq_i} \]
References:
The metric was theoretically introduced by Rao in 1945:
C. R. Rao
Information and the Accuracy Attainable in the Estimation of Statistical Parameters
Bulletin of the Calcutta Mathematical Society 37(3)here, we use a version for discrete distributions, from:
M.-M. Deza, E. Deza
Dictionary of distances- Since:
- 0.7.5
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FisherRaoDistance.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description static FisherRaoDistance
STATIC
Static instance.
-
Constructor Summary
Constructors Constructor Description FisherRaoDistance()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(NumberVector fv1, NumberVector fv2)
Computes the distance between two given DatabaseObjects according to this distance function.boolean
equals(java.lang.Object obj)
SimpleTypeInformation<? super NumberVector>
getInputTypeRestriction()
Get the input data type of the function.int
hashCode()
boolean
isMetric()
Is this distance function metric (satisfy the triangle inequality)double
minDist(SpatialComparable mbr1, SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this distance function.-
Methods inherited from class elki.distance.AbstractNumberVectorDistance
dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isSquared, isSymmetric
-
Methods inherited from interface elki.distance.SpatialPrimitiveDistance
instantiate
-
-
-
-
Field Detail
-
STATIC
public static final FisherRaoDistance STATIC
Static instance.
-
-
Constructor Detail
-
FisherRaoDistance
@Deprecated public FisherRaoDistance()
Deprecated.Rao distance. Use static instanceSTATIC
!
-
-
Method Detail
-
distance
public double distance(NumberVector fv1, NumberVector fv2)
Description copied from interface:PrimitiveDistance
Computes the distance between two given DatabaseObjects according to this distance function.- Specified by:
distance
in interfaceNumberVectorDistance<NumberVector>
- Specified by:
distance
in interfacePrimitiveDistance<NumberVector>
- Parameters:
fv1
- first DatabaseObjectfv2
- second DatabaseObject- Returns:
- the distance between two given DatabaseObjects according to this distance function
-
minDist
public double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
Description copied from interface:SpatialPrimitiveDistance
Computes the distance between the two given MBRs according to this distance function.- Specified by:
minDist
in interfaceSpatialPrimitiveDistance<NumberVector>
- Parameters:
mbr1
- the first MBR objectmbr2
- the second MBR object- Returns:
- the distance between the two given MBRs according to this distance function
-
isMetric
public boolean isMetric()
Description copied from interface:Distance
Is this distance function metric (satisfy the triangle inequality)- Specified by:
isMetric
in interfaceDistance<NumberVector>
- Returns:
true
when metric.
-
getInputTypeRestriction
public SimpleTypeInformation<? super NumberVector> getInputTypeRestriction()
Description copied from interface:Distance
Get the input data type of the function.- Specified by:
getInputTypeRestriction
in interfaceDistance<NumberVector>
- Specified by:
getInputTypeRestriction
in interfacePrimitiveDistance<NumberVector>
- Overrides:
getInputTypeRestriction
in classAbstractNumberVectorDistance
- Returns:
- Type restriction
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-