Skip to main content

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

How to show that RMSE is more sensitive to outliers than the MAE?

I am reading this book where it states that for $\ell_p$ norms: The higher the norm index, the more it focuses on large values and neglects small ones. This is why the RMSE is more sensitive to ...
ado sar's user avatar
  • 477
0 votes
0 answers
29 views

What is the meaning of term "whiten" data in relation to Mahalanobis Distance?

I'm writing my thesis and I have trouble in understanding the paper: https://people.bu.edu/bkulis/pubs/ftml_metric_learning.pdf My major is not mathematics, but I can understand the basic so I hope ...
jupyter's user avatar
  • 101
1 vote
0 answers
48 views

Why not use the $L^2$ norm as the difference between two probability distributions (as opposed to KL-Divergence and others) [closed]

So I was wondering why not just use: $$dist(p,q)=\bigg(\int_{x \in X} |p(x)-q(x)|^2 dx\bigg)^{1/2}$$ instead of the commonly used KL-Divergence, which isn't even a distance measure and therefore not ...
Anon's user avatar
  • 121
1 vote
0 answers
55 views

How to incorporate p-value information for pairwise distances into clustering?

Consider I have a $n \times n$ distance matrix I want to use for hierarchical clustering, where the distance metric I use ranges from 0-1. I also have a second $n \times n$ matrix that gives me the p-...
Jmmer's user avatar
  • 89
3 votes
1 answer
67 views

Is this a known or valid divergence between two densities?

I am testing various metrics for learning a density estimate. Specifically, I have a sample of data from a distribution $p$, and am learning a function $f$ to estimate $p$ by minimizing a distance or ...
Travis L's user avatar
  • 181
0 votes
0 answers
11 views

How to compare results to a reference with multiple measurements

I have run a pilot test in the laboratory to see which method is best out of 5 different ones. I have reference numbers for a range of measurements to compare these against and then my results for the ...
NTemp's user avatar
  • 1
0 votes
0 answers
29 views

How to perform Hierarchical Clustering using centroid method and custom distance metric?

I would like to perform Agglomerative Hierarchical Clustering using the centroid method (defined on this page) and a custom distance metric, probably cosine similarity. In the Scipy docs it says you ...
Rupert Hart's user avatar
0 votes
0 answers
131 views

Closed form expression for the 2-Wasserstein distance between generalized Gaussian distributions

Essentially the title - is there a closed form expression for the 2-Wasserstein distance (aka Frechet distance, Earth Mover's distance) between two generalized Gaussian distributions? The regular ...
Shashank Gupta's user avatar
0 votes
0 answers
38 views

Distance metric for sparse matrix with imbalanced data

I am trying to find similar movies in a dataset where each movie has zero to five genres. (I also have more dimensions but those are not relevant to the question.) For this I'm trying to use nearest ...
Paso's user avatar
  • 101
3 votes
1 answer
128 views

Appropriate distance measure for comparing probability distributions

Suppose I want to compare some countries to see how similar they are with respect to the relative sizes of the industries in them. So I find data on the distribution of GDP across all industries for ...
user32038's user avatar
3 votes
1 answer
158 views

Is L1(a,b) <= L1(c, d) if and only if L2(a,b) <= L2(c, d)? L1 vs L2

I am doing machine learning and in one stage, I have to measure tensor vector differences to find the minimum distance. Lets say I have a set of linear tensors with dimension 100. I want to find a ...
AliM's user avatar
  • 131
3 votes
0 answers
135 views

Euclidean and geodesic distance have different gradients. Does mixing the two concepts impair triplet learning?

The triplet loss is defined by Florian Schroff, Dmitry Kalenichenko, James Philbin in "FaceNet: A Unified Embedding for Face Recognition and Clustering" as $$ \mathcal L = \sum_\mathcal T \...
Sycorax's user avatar
  • 92.6k
0 votes
0 answers
18 views

Criteria for a Distance Metric to be Compatible with K-means Clustering

Referring to this post, it's mentioned that K-means clustering doesn't inherently rely on the pairwise distances between data points, and not every distance metric is suitable for k-means clustering. ...
Peyman's user avatar
  • 309
1 vote
0 answers
264 views

Jensen-Shannon Distance between two normal distributions defined only by the respective means and standard deviations

I am seeking an expression of the Jensen-Shannon Distance (JSD) between two normal distributions that only uses the respective means and standard deviations. The continuous version of the JSD (in ...
Mari153's user avatar
  • 890
1 vote
0 answers
82 views

Measuring distances between distributions of ordinal variables

I'd like to be able to measure how "different" two distributions of ordinal (but not interval) variables $X$ and $Y$ are. Given three random variables $X$, $Y$, $Z$ I'd also like to be able ...
Peter R's user avatar
  • 131
1 vote
0 answers
161 views

Linear Distance in Latent Feature Space of an AutoEncoder

I would like to perform a cluster analysis on a mixed data set containing continuous, categorical and binary data. As I have 93 features in total, I thought it might help to use an AutoEncoder to ...
Guybrush's user avatar
0 votes
0 answers
105 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 ...
Yandle's user avatar
  • 1,189
1 vote
0 answers
52 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}$....
EFG1595's user avatar
  • 11
0 votes
0 answers
16 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 ...
user371859's user avatar
1 vote
1 answer
217 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]...
Kota Mori's user avatar
  • 564
2 votes
1 answer
72 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 ...
anna6931's user avatar
  • 131
4 votes
1 answer
795 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 ...
Angus Campbell's user avatar
0 votes
0 answers
265 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?
Roman's user avatar
  • 85
0 votes
1 answer
97 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 ...
ALEX.VAMVAS's user avatar
0 votes
1 answer
550 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. ...
wex52's user avatar
  • 165
1 vote
0 answers
189 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 ...
pazkaw's user avatar
  • 11
0 votes
1 answer
83 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 ...
Fabio's user avatar
  • 3
1 vote
1 answer
231 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 ...
Mari153's user avatar
  • 890
1 vote
0 answers
56 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 ...
Nht_e0's user avatar
  • 33
0 votes
0 answers
43 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 ...
ThePortakal's user avatar
0 votes
0 answers
19 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 ...
maritsm's user avatar
  • 101
0 votes
0 answers
162 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 ...
Tianxun Zhou's user avatar
0 votes
0 answers
118 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 ...
rade's user avatar
  • 31
2 votes
1 answer
101 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)}...
Fiodor1234's user avatar
  • 2,286
1 vote
1 answer
637 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 ...
Sauhaarda Chowdhuri's user avatar
0 votes
0 answers
183 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 ...
user327865's user avatar
1 vote
0 answers
1k 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 ...
Lilo's user avatar
  • 111
3 votes
0 answers
91 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 ...
Björn's user avatar
  • 33.5k
0 votes
1 answer
190 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 ...
mcguiremichael's user avatar
0 votes
0 answers
43 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. ...
rischan's user avatar
  • 101
1 vote
1 answer
70 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 ...
DaveTheScientist's user avatar
1 vote
1 answer
175 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 ...
user10039910's user avatar
0 votes
1 answer
587 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 ...
Wingmore's user avatar
0 votes
0 answers
15 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 ...
Thomas B.'s user avatar
2 votes
0 answers
186 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)$ ...
Rylan Schaeffer's user avatar
0 votes
0 answers
38 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 ...
Meni's user avatar
  • 183
3 votes
1 answer
339 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)=...
Thomas's user avatar
  • 33
4 votes
2 answers
4k 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 ...
skynaive's user avatar
0 votes
0 answers
325 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 ...
Julian's user avatar
  • 101
10 votes
1 answer
1k 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 $...
curiousgeorge's user avatar

1
2 3 4 5
7