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
0answers
58 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 ...
1
vote
1answer
58 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)}...
1
vote
0answers
6 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
0answers
33 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 ...
0
votes
0answers
13 views

Using generalized additive models on distance matrices for species community turnover relative to environmental predictors

I have a dataset of species abundances on a plot level and environmental information on the same plots. I want to research if the community composition is changing allong the gradients of ...
0
votes
0answers
15 views

Function to sort a static list of items by recency and frequency

I'm working on a problem which requires me to sort a list of static items for each user. I understand best way to solve this problem would be to come up with a function that captures both the ...
1
vote
0answers
63 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
0answers
45 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 ...
0
votes
0answers
39 views

Reconciling cosine similarity between vectors and subsets of these vectors

I'm seeing something that I'm having a hard time reconciling in my head. Essentially, the cosine similarity between two vectors I have is very low, but cosine similarities of their subsets are very ...
0
votes
1answer
29 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
0answers
22 views

Relative mean squared error in functions estimation

The questions are actually two: What is the best way to define a relative error in function estimation? And what the best to define a relative mean squared error for the estimation of multiple ...
0
votes
0answers
20 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
1answer
28 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 ...
0
votes
0answers
114 views

Using KL divergence as a feature selection method

I have a set of features for a binary classification problem. The KL divergence could be considered as how one (probability) distribution differs from another. In a practical sense, I could use this ...
0
votes
1answer
34 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
1answer
155 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
0answers
13 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
0answers
54 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
0answers
33 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 ...
2
votes
1answer
76 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)=...
2
votes
2answers
958 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
0answers
60 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 ...
9
votes
1answer
435 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
0answers
26 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 ...
0
votes
1answer
73 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 ...
0
votes
1answer
27 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 ...
0
votes
0answers
132 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 ...
2
votes
0answers
49 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
0answers
299 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
0answers
55 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
0answers
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
1answer
60 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 ...
-1
votes
1answer
54 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
0answers
36 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 ...
2
votes
0answers
144 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 ...
1
vote
0answers
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 ...
1
vote
1answer
64 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 ...
0
votes
0answers
108 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 ...
0
votes
1answer
95 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 ...
0
votes
0answers
54 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(...
1
vote
1answer
30 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" ...
1
vote
1answer
553 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 ...
1
vote
0answers
18 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 ...
1
vote
1answer
788 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 ...
3
votes
1answer
64 views

Non-metrics give "pathological" solutions: what does this mean?

In this set of slides on DTW, slide 25 says that we generally prefer metrics over measures because, "Non-Metrics can sometimes give pathological solutions when clustering or classifying data etc." ...
3
votes
0answers
202 views

Which distance metric to use to cluster categorical sequences (clickstreams or clickpaths)?

For my research, I want to cluster website visitors based on their clickstreams to understand different information behavior patterns (i.e., customer/visitor journeys). The data can be characterized ...
0
votes
0answers
35 views

Proxy for Mahalanobis distance when n < p? [duplicate]

I'm working on a ranking problem where I want to measure the distance between a collection of query points (as a group) and each target point in my database. Each query point is part of the set of ...
2
votes
1answer
26 views

Finding the effect of nodes on a density heatmap

Let's say I have a geo-tagged dataset of all payment transactions for businesses in a city. I know whether each payment is made by cash or card, and have made a heatmap of where in the city the ...
2
votes
0answers
407 views

Relationship between KL divergence, JS divergence, and MMD?

What kind of relationship is there between the KL (Kullback-Leibler) divergence, JS (Jensen-Shannon) divergence, and MMD (maximum mean discrepancy)? I know that they all share a global minimum at $P=...
3
votes
1answer
2k views

Is one-hot encoding and standardization of data equivalent to Gower's distance?

For clustering and other techniques for mixed data (numerical and categorical), Gower's distance is usually more preferred than Euclidean distance because the former computes distance differently for ...

1
2 3 4 5
7