Introduction to the philentropy
Package
Comparison is a fundamental method of scientific research leading to
more general insights about the processes that generate similarity or
dissimilarity. In statistical terms comparisons between probability
functions are performed to infer connections, correlations, or
relationships between samples. The philentropy
package
implements optimized distance and similarity measures for comparing
probability functions. These comparisons between probability functions
have their foundations in a broad range of scientific disciplines from
mathematics to ecology. The aim of this package is to provide a base
framework for clustering, classification, statistical inference,
goodness-of-fit, non-parametric statistics, information theory, and
machine learning tasks that are based on comparing univariate or
multivariate probability functions.
Applying the method of comparison in statistics often means computing
distances between probability functions. In this context Sung-Hyuk Cha (2007)
provides a clear definition of distance :
From the scientific and mathematical point of view, distance
is defined as a quantitative degree of how far apart two objects
are.
Hence, quantifying the distance of two objects requires the
assumption about a particular space in which these objects live. For the
euclidean distance, for example, this would mean comparison of objects
(coordinates) in euclidean space (e.g. coordinate system) while other
distance measures may require different spaces to allow sensitive and
appropriate quantification of distances between objects
(e.g. probability space). This aspect of quantifying the
degree of how far two objects are apart in a defined space
(adjusted definition) motivates the existence of diverse distance
measures. As a result, the domain expert should appreciate the
responsibility to decide in which space their model or experimental data
is best represented and which distance metric then maximizes the
usefulness of object comparison within this defined space.
Cha’s comprehensive review of distance/similarity measures motivated
me to implement all these measures to better understand their
comparative nature. As Cha states:
The choice of distance/similarity measures depends on the measurement
type or representation of objects.
As a result, the philentropy
package implements
functions that are part of the following topics:
- Distance Measure
- Information Theory
- Correlation Analyses
Personally, I hope that some of these functions are helpful to the
scientific community.
Distance Measures
Here, the Distance
Measure Vignette introduces how to work with the main function
distance()
that implements the 46 distance measures
presented in Cha’s review.
Furthermore, for each distance/similarity measure a short description
on usage and performance is presented.
The following probability distance/similarity measures will be
described in detail:
Distance and Similarity Measures
Minkowski Family
- Euclidean :
- Manhattan :
- Minkowski :
- Chebyshev :
Family
- Sorensen :
- Gower :
,
where
is the total number of elements
in
and
- Soergel :
- Kulczynski d :
- Canberra :
- Lorentzian :
Intersection Family
- Intersection :
- Non-Intersection :
- Wave Hedges :
- Czekanowski :
- Motyka :
- Kulczynski s :
- Tanimoto :
; equivalent to Soergel
- Ruzicka :
; equivalent to 1 - Tanimoto = 1 - Soergel
Inner Product Family
- Inner Product :
- Harmonic mean :
- Cosine :
- Kumar-Hassebrook (PCE) :
- Jaccard :
; equivalent to 1 - Kumar-Hassebrook
- Dice :
Squared-chord Family
- Fidelity :
- Bhattacharyya :
- Hellinger :
- Matusita :
- Squared-chord :
Squared
family
(
squared family)
- Squared Euclidean :
- Pearson
:
- Neyman
:
- Squared
:
- Probabilistic Symmetric
:
- Divergence :
:
- Clark :
- Additive Symmetric
:
Shannon’s Entropy Family
- Kullback-Leibler :
- Jeffreys :
- K divergence :
- Topsoe :
- Jensen-Shannon :
- Jensen difference :
Combinations
- Taneja :
- Kumar-Johnson :
- Avg(,
)
:
Note:
refers to distance measures, whereas
denotes similarity measures.
Modern methods for distribution comparisons have a strong information
theoretic background. This fact motivated me to name this package
philentropy
and as a result, several well established
information theory measures are (and further will be) implemented in
this package.
- Shannon’s Entropy H(X) :
- Shannon’s Joint-Entropy H(X,Y) :
- Shannon’s Conditional-Entropy H(X | Y) :
- Mutual Information I(X,Y) :
- Kullback-Leibler Divergence :
- Jensen-Shannon Divergence :
- Generalized Jensen-Shannon Divergence :