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
16 views

Euclidean distance between points in high dimensions

On Wikipedia there's a statement: When a measure such as a Euclidean distance is defined using many coordinates, there is little difference in the distances between different pairs of samples. Is ...
  • 915
0 votes
0 answers
8 views

What is a good dissimilarity on rooted ordered labeled trees with probabilities on the leaves?

Consider a rooted ordered labeled tree that is "binary" in that there are at most two children of any vertex and whose leaves are decorated with probabilities (the sum of the leaf ...
1 vote
0 answers
27 views

How to define a distance metric between nodes of an Origin-Destination matrix?

I have an Origin-Destination matrix expressing (weekly) flows of people between every couple of nodes (cities). The number of people traveling from city $i$ to city $j$ in a specific week is $OD_{ij}$....
  • 11
0 votes
0 answers
9 views

Help calculating the Bhattacharya Coefficient for measuring tracking efficiency

I'm working with OpenCV which has some tracking algorithms (BOOSTING, MIL, KCF, MEDIANFLOW, TLD, ...). I've read many papers where they use the Bhattacharya Coefficient to measure the efficiency of ...
1 vote
1 answer
28 views

Distance measure between two sequences of different lengths [duplicate]

I am looking for some distance (or similarity) measure between two sequences, possibly of different lengths. Conceptually, I would like a measure with a property that $[3,1,5]$ is similar to $[3,1,4,5]...
  • 534
2 votes
1 answer
36 views

Is this Hellinger Distance expression correct?

Further to my previous post on the Hellinger Distance, there was one comment raised about there being different expressions of the Hellinger Distance. This has intrigued me. In the Encyclopedia of ...
3 votes
1 answer
132 views

Is there an R or python package to calculate wasserstein metric between negative binomial distributions?

As the title says I am looking for an R or python package which can calculate wasserstein distance (aka earthmovers distance between) two lists (vectors) of sampled values from a negative binomial ...
0 votes
0 answers
20 views

Calculate distance between generated probability distribution/point and target distribution

In my current project I have a trained neural network (pytorch-based), which is used for classifying data into n labels. Based on my current experience this is done ...
  • 101
0 votes
0 answers
52 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 ...
  • 113
0 votes
0 answers
135 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?
  • 33
0 votes
1 answer
41 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 ...
0 votes
1 answer
209 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. ...
  • 145
1 vote
0 answers
102 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 ...
  • 11
0 votes
1 answer
39 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 ...
  • 3
1 vote
1 answer
114 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 ...
  • 633
1 vote
0 answers
38 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 ...
  • 33
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 ...
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 ...
  • 101
0 votes
0 answers
106 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 ...
0 votes
0 answers
77 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 ...
  • 31
2 votes
1 answer
94 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)}...
  • 2,028
1 vote
1 answer
329 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
151 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
870 views

k-means inertia

I use Minkoski distance to measure distance, like so: $$D(\vec{x}, \vec{y})=\left(\sum_{i=1}^n|x_i-y_i|^p\right)^\frac{1}{p}$$ I'm trying to locally optimize centroids by averaging the points that ...
  • 111
3 votes
0 answers
56 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 ...
  • 25.9k
0 votes
1 answer
127 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 ...
0 votes
0 answers
38 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. ...
  • 101
1 vote
1 answer
55 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 ...
1 vote
1 answer
114 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 ...
0 votes
1 answer
379 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 ...
2 votes
0 answers
114 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)$ ...
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 ...
  • 183
3 votes
1 answer
208 views

Do $k$-means, dbscan, and hierarchical clustering all rely on (pseudo)metrics?

I seems to me that the clustering methods $k$-means, dbscan, and hierarchical clustering all work on distance measures $d$ that are (pseudo)metrics, i.e., fulfill the following requirements: $$ d(x,x)=...
3 votes
2 answers
3k views

Is Jaccard similarity/distance suitable for non-binary, quantitative data?

I have a dataset with each row a country and 10 columns with numerical features like GDP,Electrcity consumption, GNI etc. I am trying to use distance metrics to find similarity between the countries ...
0 votes
0 answers
150 views

Creating a covariance matrix from a distance matrix—normalizing matrix with infinity

I'm trying to simulate spatially autocorrelated data by creating a covariance matrix from a distance matrix and using said covariance matrix as the $\Sigma$ parameter of a multivariate normal. I have ...
  • 101
10 votes
1 answer
878 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
0 answers
44 views

How to calculate similarity between two sets of items rated on a single dimension?

(I'm just making up variables for this example.) Let's say I have 100 words rated on their pleasantness. I also have 100 images rated on their pleasantness. I then had participants rate the fit ...
  • 1,791
0 votes
1 answer
181 views

Is there a distance metric between ordered vectors?

I am looking for a distance metric between vectors whose elements are ordered, i.e so the vectors: [1,5,0,0,0,0,1], [1,0,4,0,0,1,0] will be considered closer than [1,5,0,0,0,0,1], [1,0,0,1,5,0,0] for ...
1 vote
1 answer
31 views

Ordering list of items by two criteria

I have a list of items with two scores: scoreA and scoreB. To be more specific they represent the average of a list of accuracy scores and their maximum. Both of the scores range from 0 to 100%. I'm ...
  • 672
0 votes
0 answers
343 views

Jaccard/binary (dis)similarity calculation to multidimensional scaling analysis

I have n N x n dataset of features (n) and subjects (N) in which I am attempting to cluster into a lower-dimensional space via multi-dimensional scaling. I'm confused about which MDS setup I need to ...
  • 327
2 votes
0 answers
192 views

Similarity between clusters/groups?

I have a dataset consisting of multiple groups in a high dimensional space. An example is shown below: What would be the best way to calculate similarities between groups. Say how similar is group A ...
2 votes
0 answers
415 views

How to calculate Mahalanobis distance in very high dimensions with both continuous and categorical variables?

The objective is outlier detection via a distance measure. Does mahalanobis distance suffer from curse of dimensionality just like Eucledian distance for very high dimensions? (say around 5000 ...
2 votes
0 answers
80 views

Hierarchical clustering: distance/linkage combination that allows starting in the middle of the dendrogram

I want to use hierarchical clustering to classify some ecological data (species abundances on different places), so I would like to use a Manhattan type distance that doesn't account for double ...
0 votes
0 answers
10 views

Finding the relative 'importance' of different vector components when defining distance of two vectors in a space [duplicate]

I have a multi-dimensional space with $d$ dimensions wherein $i$ vectors ($v_1 ... v_i$) with $d$ components live. I want to find a function $s(v_a, v_b)$ which takes in two of these vectors and ...
1 vote
1 answer
91 views

Metric for distance of sinewaves

I have time-series data consisting of the sum of 2 sinewaves and my goal is to predict their frequencies and their amplitudes. I would like to know what are the best distance metrics/loss functions I ...
  • 31
-1 votes
1 answer
78 views

How to unsupervised-cluster of binary vectors?

I have a set of binary vectors of roughly 500 dimensions. For EDA purposes mainly, I'd like to cluster them, maybe hierarchically. What could be the right distance metric for my problem? Is the ...
2 votes
0 answers
92 views

Determine outliers for robust Mahalanobis distance

I want to apply a robust mahal distance and found an implementation in scikit. but there is the number of outliers already given in advance. For me, who wants to find out the number of outliers, this ...
  • 2,839
2 votes
0 answers
274 views

Distance measure for two probability distribution of unequal sample size

Context: I have 100 stores and these stores are divided into 10 business markets. I want to select 3 markets where each market is a good representation of the 100 stores i.e. the population. There ...
  • 43
1 vote
0 answers
35 views

How to transform $P[k_1\leq (x_i-\mu - \sigma\cdot Z)^2 \leq k_2]$ to $P[k_1\leq \frac{(x_i-\mu)^2}{\sigma^2}+e \leq k_2]$?

Taste estimation As an example consider an experiment conducted to determine the optimal concentration of salt in popcorn. The concentration of salt in sample $i$ is denoted by ${x_i}$. The subject ...
  • 11

1
2 3 4 5
7