Questions tagged [distance-functions]

Distance functions refer to functions used for quantifying the notion of distance between members of a set, or between objects.

Filter by
Sorted by
Tagged with
0 votes
0 answers
5 views

Differences between Bhattacharyya distance and Jensen–Shannon divergence

Based on Wikipedia, both the Bhattacharyya distance and Jensen–Shannon divergence are a method of measuring the similarity between two probability distributions. But now curious about - how are they ...
0 votes
0 answers
71 views

Wasserstein distance between multivariate lognormal distributions

Wikipedia gives the following formula for normal distributions: What changes, if any, do I need to make to handle multivariate lognormal distributions instead?
0 votes
1 answer
34 views

Different distance matrixes result in the same clustering

I am using: the cluster::pam function in R for clustering distance matrix computed using Gower distance in cluster::daisy in R The issue I am having is that I run pam 2 times, with a different ...
3 votes
2 answers
987 views

Can I compare Mahalanobis distances from different distributions?

I have a multivariate dataset representing multiple locations, each of which has a set of reference observations and a single test observation. For each location, I would like to measure how anomalous ...
0 votes
1 answer
88 views

Dynamic Time Warping: Why does a Sakoe-Chiba band take much more time to calculate than no window?

I'm using dynamic time warping to calculate a distance matrix for a set of about 25 multivariate time series. Each individual time series has over 1000 timestamps, and they are all the same length. ...
2 votes
1 answer
404 views

Is Wishart distance always positive?

From what is told on page 268 of the Polarimetric Radar Imaging: From Basics To Applications: I have written the following code for wishart distance calculation in Matlab: ...
8 votes
3 answers
9k views

How to measure distance for features with different scales?

I'm reading the book "Collective Intelligence" and in one chapter they introduce how to measure similarity between users on a movie review website with euclidean distance. Now are the movies rated ...
34 votes
1 answer
26k views

Comparing hierarchical clustering dendrograms obtained by different distances & methods

[The initial title "Measurement of similarity for hierarchical clustering trees" was later changed by @ttnphns to better reflect the topic] I am performing a number of hierarchical cluster analyses ...
1 vote
0 answers
48 views

What are the moments of the Beckmann distribution?

Let $U=(u_1, u_2)$ and $V=(v_1, v_2)$ be two randomly distributed points on the Euclidean plane assuming bivariate normal distributions $U \sim N(\mu_u, \Sigma_u)$ and $V \sim N(\mu_v, \Sigma_v)$ with ...
337 votes
8 answers
131k views

Why is Euclidean distance not a good metric in high dimensions?

I read that 'Euclidean distance is not a good distance in high dimensions'. I guess this statement has something to do with the curse of dimensionality, but what exactly? Besides, what is 'high ...
0 votes
1 answer
34 views

difference between sets of ordered categorical variables

I have two sets (S1, S2) of answers to a typical survey question with ordered categorical (discrete) answers (“strongly disagree”, “disagree”, … ,” strongly agree”). I need to test whether I should ...
1 vote
1 answer
73 views

What is the correct expression of the Hellinger Distance equation?

I am aware there are various ways to calculate the Hellinger Distance (H) depending on the context and data. One of these ways, as I understand, is via the Bhattacharyya coefficient (BC). For discrete ...
1 vote
1 answer
116 views

Bhattacharya Distance for Sets of Vectors

I have two sets of vectors and want to find a differentiable measure that can help quantify/approximate the degree of separability of the two sets. This metric might correlate well with the ...
0 votes
0 answers
30 views

How to find the 'distance' between two populations?

I am somewhat new to these concepts, so please bear with me. I have two datasets: Data set A is collected by monitoring the network data of a device when it is ...
5 votes
1 answer
1k views

Bhattacharyya distance for three histograms

There is a paper “Auto White Balance Based on the Similarity of Chromaticity Histograms” mention about automatic white balance. One of the key point of this algorithm is how to measure the similarity ...
0 votes
0 answers
548 views

Analysis or Comparison of Euclidean Distance matrix

Related: Average distance in distance matrix I'm looking for some way to compare euclidean distance matrices. The matrices I need to compare will have constant number of rows but varying number of ...
15 votes
5 answers
2k views

Best distance measure to use to compare vectors of angles

Context I have two sets of data that I want to compare. Each data element in both sets is a vector containing 22 angles (all between $-\pi$ and $\pi$). The angles relate to a given human pose ...
0 votes
0 answers
32 views

A distance function between music playlists

I am looking for a way to measure the dissimilarity/distance $d$ between a set of music playlists $\{P_i\}$ with possibly different number of songs. We may assume that a playlist contains a specific ...
3 votes
1 answer
2k views

Jeffries Matusita distance for 14 variables

I wish to perform Jeffries-Matusita distance on 14 spectral bands. Is there anyone who can help with how it is done in R?
1 vote
0 answers
190 views

Is there an analytic form for the Hellinger distance between von Mises distributions?

Is there an analytic form for the Hellinger distance between von Mises distributions?
0 votes
0 answers
14 views

Why is the covariance matrix inverted in the definition of the Mahalanobis distance? [duplicate]

I'm on my first course on data science, and I encountered the Mahalanobis distance for the first time. It was mentioned that intuitively, what it does is that it corrects for the fact that some ...
0 votes
0 answers
50 views

How to test the similarity between two labelled datasets?

I have two different functions with I can draw labelled data $(x, y)$ from, where $x$ is multi-dimensional, and $y$ is a real number value. There exist a $y$ value for any possible $x$ in the input ...
1 vote
0 answers
801 views

How does Gower distance work with free text?

The Gower distance measure is a good measure for mixed-type data (i.e., data attributes can be qualitative, categorical, ordinal or binary). But can data attributes be free-text (e.g., names of people)...
49 votes
2 answers
38k views

Hierarchical clustering with mixed type data - what distance/similarity to use?

In my dataset we have both continuous and naturally discrete variables. I want to know whether we can do hierarchical clustering using both type of variables. And if yes, what distance measure is ...
0 votes
0 answers
68 views

Is the expected distance of two random variables a Metric?

This is purely for more understanding and not an assignment. I understand the definition of a metric https://en.wikipedia.org/wiki/Metric_(mathematics). I also understand that the following is a ...
2 votes
0 answers
80 views

How to Show Wasserstein Metric is Sum Invariant?

A paper I'm trying to understand states that that Wasserstein metric obeys certain properties, which I'd like to prove. This metric is defined for two random variables $U, V$ and $p \in (1, \infty)$ ...
1 vote
1 answer
83 views

Kullback-Leibler distance calculation for discrete distributions?

I have the following model $$N \sim Pois(\lambda) \\ n \sim Bin(N,p)$$ for which I calculate the posterior for the parameter $N$ as $$\pi(N|n,p,\lambda) = \frac{f(n|N,p)\pi(N|\lambda)}{f(n|p,\lambda)}...
0 votes
0 answers
110 views

Weighted metric for mixed binary (decomposed) data?

I have a large dataset with mixed type of data (example): Age Price Town Size Interests Small Middle Big Traveling Cooking TV 21 0 1 0 0 1 1 1 34 100 0 1 0 0 1 0 81 200 0 0 1 1 1 0 54 0 0 0 1 1 ...
1 vote
0 answers
419 views

k-means inertia

I use Minkoski distance to measure distance, like so: I'm trying to locally optimize centroids by averaging the points that were assigned to the centroids. After using k-means with (p,k) when p is ...
3 votes
0 answers
53 views

Metrics for assessing the quality of prior distributions

Clarification: My purpose is to compare different methods for selecting/creating priors (or perhaps I should refer to them as predictive distributions for a quantity of interest/parameter). I do not ...
2 votes
2 answers
400 views

Clustering before or after ordination

Can someone explain the implications of performing clustering either before or after performing NMDS? I have some ecological data and I am performing a clustering analysis to identify communities of ...
8 votes
2 answers
2k views

Is there a version of the Mahalanobis distance for matrices?

I'm working on a computer vision problem and I want to use the Mahalanobis distance to cluster image patches (2D matrices having the same dimensions). I haven't been able to find any generalisation up ...
0 votes
1 answer
91 views

How can one compute the "average" of a dataset of histograms that minimizes the mean Earth Mover's Distance between all data points and average?

It is my understanding that when the distance metric is euclidean distance, the mean of a dataset minimizes the average distance between all data points and the computed "mean". In the case ...
12 votes
6 answers
13k views

Jensen-Shannon divergence calculation for 3 prob distributions: Is this ok?

I would like to calculate the jensen-shannon divergence for he following 3 distributions. Is the calculation below correct? (I followed the JSD formula from wikipedia): ...
1 vote
0 answers
1k views

Distribution of the Mahalanobis distance between two samples from a Gaussian distribution

Let $\mathbf{X}=(X_1,\dots,X_p)\sim\mathcal{N}(\mu,\Sigma)$ be a Gaussian random vector. We all know that $$d^2(\mathbf{X},\mu) = (\mathbf{X}-\mu)^T\Sigma^{-1}(\mathbf{X}-\mu) $$ has a $\chi^2_p-$...
0 votes
0 answers
23 views

Measuring the overlap between two probability distribution [duplicate]

I have many probability distributions, I need to compute the amount of overlap between two probability distributions. I don't know the type of distribution since it really depends on the data itself. ...
1 vote
3 answers
6k views

Ask for suggestions on clustering methods on a large dataset with mixed types of variables

I need to build segmentation on a large customer dataset with more than 300K records and many variables, including continuous like income and age, ordinal like education level and membership level, ...
53 votes
4 answers
15k views

Kullback–Leibler vs Kolmogorov-Smirnov distance

I can see that there are a lot of formal differences between Kullback–Leibler vs Kolmogorov-Smirnov distance measures. However, both are used to measure the distance between distributions. Is there a ...
1 vote
1 answer
38 views

Modified distance functions for a cluster analysis

I'm developing some software to allow users to perform various kinds of clustering on some data using a pairwise distance matrix (k-medoids is the main method). I would like to allow the user to tune ...
6 votes
1 answer
9k views

Similarity metrics for more than two vectors?

I am aware of Cosine Similarity which measure the angle between "two" vectors. Prototype for cosine similarity would look something like this: ...
4 votes
1 answer
2k views

Why is k-medians typically used with Manhattan rather than Euclidean distance?

K-medians is typically used with Manhattan distance rather than Euclidean distance. Why is this?
9 votes
1 answer
719 views

What's an intuitive way to understand how KL divergence differs from other similarity metrics?

The general intuition I have seen for KL divergence is that it computes the difference in expected length sampling from distribution $P$ with an optimal code for $P$ versus sampling from distribution $...
0 votes
1 answer
79 views

Measure of distance between two survey responses

I've found some survey data where respondents answer 63 question by giving a response for each question between 0-10 (0 for strong disagreement, 10 for strong agreement). So I can view every ...
10 votes
2 answers
3k views

Looking for a robust, distribution-free/nonparametric distance between multivariate samples

There are many distance functions for distributions out there, but I'm having a hard time wading through them all to find one that is "distribution-free", or "nonparametric", by which I mean only ...
19 votes
4 answers
8k views

Is it ok to use Manhattan distance with Ward's inter-cluster linkage in hierarchical clustering?

I am using hierarchical clustering to analyze time series data. My code is implemented using the Mathematica function DirectAgglomerate[...], which generates ...
22 votes
4 answers
45k views

Euclidean distance score and similarity

I'm just working with the book Collective Intelligence (by Toby Segaran) and came across the Euclidean distance score. In the book the author shows how to calculate the similarity between two ...
0 votes
1 answer
287 views

High Dimensional Swiss Roll? (For Metric Learning/Dimensionality Reduction)

So I've just started a project which includes some metric learning, and came accross this swiss roll in 3D to 2D problem. Ideally, you should 'unroll' the roll. My question is, can this be extended ...
0 votes
0 answers
14 views

Splitting method for time series

Say I have a website with a lot of pages and traffic. Some of them are more visited, some of them a less. My task is to split pages into two groups for the given time period, so that the total traffic ...
9 votes
1 answer
9k views

Can KL-Divergence ever be greater than 1?

I've been working on building some test statistics based on the KL-Divergence, \begin{equation} D_{KL}(p \| q) = \sum_i p(i) \log\left(\frac{p(i)}{q(i)}\right), \end{equation} And I ended up with a ...
0 votes
0 answers
36 views

Measuring the amount of total influence between variables?

I have a group of people with a series of yes/no questuins about preferences in various topics. The thing is they could see each other answers and change theirs hence might be influenced by a common ...

1
2 3 4 5
7