Vector-Based Distances

Introduction

When comparing vectors, it is crucial to understand the different mathematical principles and methods that can be applied depending on the type of data and the context. The Distancia package provides a comprehensive suite of vector-based distance measures that allow for the evaluation of similarity or dissimilarity between vectors. These methods can be applied in domains such as machine learning, signal processing, and data clustering, among others.

Metric Distances

Metric distances follow mathematical properties such as symmetry, non-negativity, and the triangle inequality. These distances are often used when a precise, geometrically consistent measurement is required between vectors.

Vector-Based Distance Measures

This section organizes vector-based distance measures into distinct categories for better clarity and understanding. Each measure is linked to its respective documentation or mathematical definition.

Euclidean and Minkowski Family

These distances are based on geometric norms and are widely used in various applications.

  1. Euclidean The straight-line distance between two points in Euclidean space.

  2. Minkowski The Minkowski distance is a generalized metric for measuring the distance between two points in a normed vector space.

  3. Manhattan The sum of absolute differences between vector components, also known as L1 norm.

  4. Chebyshev The maximum absolute difference between vector components, corresponding to L∞ norm.

  5. Canberra A weighted metric emphasizing small differences between components.

Similarity Measures

These metrics quantify similarity rather than dissimilarity between vectors.

  1. Jaccard The intersection over the union of two binary vectors.

  2. GeneralizedJaccard Extends Jaccard to weighted vectors.

  3. Tanimoto A similarity metric similar to Jaccard, used in chemistry and information retrieval.

  4. Ochiai A cosine-like measure for binary overlaps.

  5. CzekanowskiDice A similarity measure emphasizing common elements.

  6. Pearson Measures linear correlation between two vectors.

  7. Spearman A rank-based correlation metric.

Probabilistic and Divergence Measures

Metrics designed for comparing probability distributions or statistical properties.

  1. Bhattacharyya Quantifies similarity between two probability distributions.

  2. KullbackLeibler A divergence metric for comparing probability distributions, often asymmetric.

  3. Hellinger Computes the divergence based on the Bhattacharyya coefficient.

  4. Wasserstein Also known as Earth Mover’s Distance, measures the effort required to transform one distribution into another.

Binary and Categorical Measures

Specialized for binary vectors and categorical data.

  1. RogersTanimoto Focuses on binary matches and mismatches.

  2. RussellRao Measures binary similarity based on shared ones.

  3. SokalMichener Evaluates binary dissimilarity using equal weighting for matches.

  4. SokalSneath A variant of SokalMichener with different weighting.

  5. EnhancedRogersTanimoto An improved version of RogersTanimoto.

  6. FagerMcGowan Derived from ecological studies, adapted for binary data.

  7. Otsuka Measures binary similarity, emphasizing shared proportions.

Geometric and Contextual Measures

Metrics designed for spatial and contextual data.

  1. Haversine Computes spherical distances, useful for geographic coordinates.

  2. ContextualDynamicDistance Adapts dynamically based on data properties.

  3. Gestalt Captures overall alignment between two vectors.

Graph and Miscellaneous Measures

Unique metrics for specialized applications, including graph theory.

  1. MotzkinStraus Used in graph-theoretic contexts, adapted for vectors.

  2. BrayCurtis Measures compositional dissimilarity in ecology.

  3. Gower A general similarity measure applicable to mixed-type data.

This categorized approach facilitates better navigation and understanding of vector-based distance measures, aligning them with specific domains and applications.

Conclusion

The Distancia package provides a versatile and robust collection of vector-based distance measures, allowing users to compare vectors in various ways depending on their specific needs. By categorizing distances into metric, non-metric, probabilistic, and information-theoretic types, Distancia enables flexible and accurate vector comparisons. Whether you need to compute exact geometric distances or probabilistic differences, Distancia offers a comprehensive toolkit for analyzing the relationships between vectors in your data.