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 ...
user avatar
  • 113
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?
user avatar
  • 23
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 ...
user avatar
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. ...
user avatar
  • 145
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 ...
user avatar
  • 11
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 ...
user avatar
  • 3
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 ...
user avatar
  • 445
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 ...
user avatar
  • 21
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 ...
user avatar
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 ...
user avatar
  • 101
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 ...
user avatar
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 ...
user avatar
  • 31
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)}...
user avatar
  • 1,711
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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
  • 111
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 ...
user avatar
  • 23.4k
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 ...
user avatar
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. ...
user avatar
  • 101
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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
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)$ ...
user avatar
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 ...
user avatar
  • 183
2 votes
1 answer
137 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)=...
user avatar
3 votes
2 answers
2k 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 ...
user avatar
0 votes
0 answers
104 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 ...
user avatar
  • 101
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 $...
user avatar
0 votes
0 answers
43 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 ...
user avatar
  • 1,661
0 votes
1 answer
135 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 ...
user avatar
1 vote
1 answer
30 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 ...
user avatar
  • 672
0 votes
0 answers
260 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 ...
user avatar
  • 317
2 votes
0 answers
129 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 ...
user avatar
2 votes
0 answers
360 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 ...
user avatar
2 votes
0 answers
70 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 ...
user avatar
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 ...
user avatar
1 vote
1 answer
82 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 ...
user avatar
  • 31
-1 votes
1 answer
68 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 ...
user avatar
2 votes
0 answers
58 views

Determine outliers for robust Mahalanobis distance

I want to apply a robust mahal distance and found an implementation in scikit: https://scikit-learn.org/stable/auto_examples/covariance/plot_mahalanobis_distances.html but there is the number of ...
user avatar
  • 2,309
2 votes
0 answers
239 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 ...
user avatar
  • 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 ...
user avatar
  • 11
1 vote
1 answer
82 views

Understanding PAM - why is it greedy?

I've been studying k-medoids for a while but i can't understand the first step or BUILD step: in particular i can't get how the initial medoids would be "greedy". I'm not much confident with the ...
user avatar
  • 53
0 votes
0 answers
164 views

How to measure the difference between two random forest models?

Suppose that I have training data defined as a set of N records (or samples) defined by its attributes (or descriptors, features, as you prefer), and I trained two random forest models with two parts ...
user avatar
0 votes
1 answer
141 views

Mahalanobis distance - understanding the formula [duplicate]

I've read quite a few explanations on this topic, liking this one the most: https://mccormickml.com/2014/07/22/mahalanobis-distance/ But there is still one thing I don't understand. I understand ...
user avatar
0 votes
0 answers
83 views

Type of logarithm in Jenson-Shannon and Bhattacharyya distance

Both Jenson-Shannon and Bhattacharyya distance can be used to measure the similarity of two probability distributions. Bhattacharyya distance between two distributions $p$ and $q$ is defined as $D_B(...
user avatar
  • 111
1 vote
1 answer
59 views

Dissimilarity or distance metrics between pairs of values

I have cubes (objects) in which their volume was manually calculated (let's call this method the "manual method". Assume that the volume measures obtained by this method are considered the "true" ...
user avatar
2 votes
1 answer
928 views

Am I right that Calinski-Harabasz index (Pseudo-F) can not be calculated from a distance matrix other than euclidean?

Part: I wonder if one could calculate the Calinski-Harabasz index when only having a distance matrix (and a cluster solution, of course). As you need the within and between sum of squares to come up ...
user avatar
  • 51
1 vote
0 answers
22 views

Does Mahalanabis Distance have something to do with Min-Max normalisation? [duplicate]

Does Mahalanabis Distance have something to do with Min-Max normalisation? I know that it has something to do with Z-score normalisation, but when I tried Mahalanabis Distance on the Min-max ...
user avatar
  • 41
1 vote
1 answer
1k views

Is Hierarchical clustering a special case of knn(specific n=1)?

I'm working on time series in the scope of similarity detection at the moment. What seems to be a well researched approach is dynamic time warping in combination with k-1NN as classification ...
user avatar
  • 21

1
2 3 4 5
7