Hellinger Distance Calculator

Online calculator for computing the Hellinger Distance

Hellinger Distance Calculator

The Hellinger Distance

The Hellinger distance is a metric for probability measures that can be represented by probability densities.

Enter Probability Distributions
First probability distribution (space separated)
Second probability distribution (space separated)
Hellinger Distance Results
Distance H(X,Y):
Hellinger Distance Properties

Range: The Hellinger distance ranges between 0 (identical distributions) and √2 (maximum distance)

H ∈ [0,√2] Metric Symmetric

Hellinger Distance Concept

The Hellinger distance measures the differences between probability distributions.
Based on the square roots of probability densities.

P(x) Q(x) p x

Distribution P(x) Distribution Q(x)


What is the Hellinger Distance?

The Hellinger distance is a fundamental metric in probability theory:

  • Definition: Measures the distance between two probability distributions
  • Range: Values between 0 (identical distributions) and √2 (maximum distance)
  • Metric: Satisfies all properties of a mathematical metric
  • Application: Statistics, information theory, machine learning
  • Basis: Based on L²-norm of square roots
  • Invariance: Invariant under bijective transformations

Hellinger Distance Properties

The Hellinger distance possesses important mathematical properties:

Metric Properties
  • Symmetry: H(P,Q) = H(Q,P)
  • Definiteness: H(P,Q) = 0 ⟺ P = Q
  • Triangle Inequality: H(P,R) ≤ H(P,Q) + H(Q,R)
  • Range: 0 ≤ H(P,Q) ≤ √2
Statistical Properties
  • Affine Invariance: Invariant under affine transformations
  • Continuity: Continuous with respect to weak convergence
  • Scaling: H(√P, √Q) direct interpretation
  • Quadratic: H² is additive for independent components

Applications of the Hellinger Distance

The Hellinger distance finds application in many statistical fields:

Statistics & Analysis
  • Hypothesis tests: Distribution comparison
  • Goodness-of-fit tests
  • Robust statistics: Outlier-resistant estimators
  • Bayesian analysis: Prior-posterior comparison
Machine Learning
  • Clustering: Distance measure for probability models
  • Dimensionality reduction: Manifold learning
  • Anomaly detection: Deviation from normal distributions
  • Generative models: GANs, VAEs evaluation
Information Theory
  • Signal processing: Spectral analysis
  • Image processing: Texture and pattern comparison
  • Cryptography: Random generator quality
  • Communication theory: Channel capacity
Natural Sciences
  • Biology: Phylogenetic analyses
  • Physics: Quantum states, phase transitions
  • Chemistry: Molecular configurations
  • Medicine: Diagnostic procedures, image analysis

Formulas for the Hellinger Distance

Continuous Form
\[H(P,Q) = \left(\frac{1}{2} \int (\sqrt{p(x)} - \sqrt{q(x)})^2 \, dx\right)^{1/2}\]

For continuous probability densities p(x) and q(x)

Discrete Form
\[H(P,Q) = \frac{1}{\sqrt{2}} \sqrt{\sum_{i=1}^{n} (\sqrt{p_i} - \sqrt{q_i})^2}\]

For discrete probability distributions

Squared Form
\[H^2(P,Q) = \frac{1}{2} \int (\sqrt{p(x)} - \sqrt{q(x)})^2 \, dx\]

Often used for theoretical analyses

Alternative Representation
\[H^2(P,Q) = 1 - \int \sqrt{p(x) \cdot q(x)} \, dx\]

Via the Bhattacharyya coefficient

Bhattacharyya Coefficient
\[BC(P,Q) = \int \sqrt{p(x) \cdot q(x)} \, dx\]

Relationship: H²(P,Q) = 1 - BC(P,Q)

Maximum Distance
\[H_{max} = \sqrt{2}\]

Achieved for orthogonal distributions

Example Calculation for the Hellinger Distance

Given
P = [0.4, 0.3, 0.2, 0.1] Q = [0.2, 0.3, 0.3, 0.2]

Calculate: Hellinger distance between probability distributions P and Q

1. Calculate Square Roots
\[\sqrt{P} = [0.632, 0.548, 0.447, 0.316]\] \[\sqrt{Q} = [0.447, 0.548, 0.548, 0.447]\]

Square roots of probabilities

2. Calculate Differences
\[\sqrt{P} - \sqrt{Q} = [0.185, 0, -0.101, -0.131]\]

Element-wise differences of square roots

3. Squared Differences
\[(\sqrt{P} - \sqrt{Q})^2 = [0.034, 0, 0.010, 0.017]\] \[\sum = 0.061\]

Squared differences and their sum

4. Hellinger Distance
\[H(P,Q) = \frac{1}{\sqrt{2}} \sqrt{0.061} = 0.175\]

Final computation of Hellinger distance

5. Interpretation
H(P,Q) = 0.175 Similarity = 87.6%
Relative Distance = 12.4% Max. Distance = √2 ≈ 1.414

The distributions are very similar with only 12.4% relative distance from maximum

Mathematical Foundations of the Hellinger Distance

The Hellinger distance was introduced by Ernst Hellinger in 1909 and is a fundamental metric in probability theory. It measures the "distance" between two probability distributions in a geometrically interpretable way.

Definition and Basic Properties

The Hellinger distance is characterized by its unique geometric interpretation:

  • Geometric Basis: Based on L²-norm of the difference of square roots of densities
  • Metric Properties: Satisfies all axioms of a mathematical metric
  • Symmetry: H(P,Q) = H(Q,P) for all probability measures P and Q
  • Normalization: Values between 0 and √2, independent of dimension
  • Invariance: Invariant under bijective, measure-preserving transformations

Relationship to Other Distance Measures

The Hellinger distance is closely related to other important statistical measures:

Bhattacharyya Distance

The Bhattacharyya coefficient BC(P,Q) is related to the Hellinger distance via H²(P,Q) = 1 - BC(P,Q).

Total Variation

It holds: H²(P,Q) ≤ TV(P,Q) ≤ √2 · H(P,Q), where TV is the total variation distance.

Kullback-Leibler Divergence

While KL divergence is asymmetric, the Hellinger distance offers a symmetric alternative for distribution comparison.

Chi-Squared Distance

The Hellinger distance is often more robust than chi-squared distances for distributions with small probabilities.

Theoretical Properties

The Hellinger distance possesses important theoretical properties:

Statistical Properties

The Hellinger distance is particularly useful for robust statistics, as it is less sensitive to outliers than other distance measures.

Convergence

Convergence in Hellinger distance implies weak convergence of probability measures, which is important for asymptotic analysis.

Information Theory

The Hellinger distance has connections to information theory and can be interpreted as a measure of information loss.

Optimal Transport

In optimal transport theory, the Hellinger distance provides important bounds for Wasserstein distances.

Practical Advantages

The Hellinger distance offers several practical advantages:

Computational Efficiency
  • Simple Computation: Direct formula without complex optimization
  • Parallelizable: Element-wise computation enables efficient implementation
  • Numerically Stable: Avoids problems with logarithmic singularities
  • Scalable: Well-suited for high-dimensional problems
Interpretability
  • Geometric Intuition: Corresponds to Euclidean distance after transformation
  • Normalized Values: Fixed bounds [0, √2] facilitate interpretation
  • Symmetry: Treats both distributions equally
  • Robustness: Less sensitive to small perturbations

Specialized Applications

Signal Processing

In digital signal processing, the Hellinger distance is used for spectral analysis and pattern recognition.

Image Processing

For histogram comparison in image analysis, the Hellinger distance provides robust similarity measurement.

Bioinformatics

Analysis of gene expression profiles and phylogenetic trees uses the metric properties of the Hellinger distance.

Financial Statistics

Risk management and portfolio analysis use the Hellinger distance for return distribution comparison.

Summary

The Hellinger distance combines mathematical elegance with practical applicability. As a true metric with geometric interpretation, it provides a robust and efficient method for comparing probability distributions. Its theoretical properties make it a valuable tool in modern statistics, while its computational efficiency enables practical applications in big data and machine learning. The combination of robustness, interpretability, and mathematical rigor makes the Hellinger distance one of the most important metrics in probability theory and its applications.

Is this page helpful?            
Thank you for your feedback!

Sorry about that

How can we improve it?