Questions tagged [distance]

Measure of distance between distributions or variables, such as Euclidean distance between points in n-space.

Filter by
Sorted by
Tagged with
2
votes
0answers
404 views

How to make results using Hellinger distance comparable with Euclidean distance outputs?

I have a two kinds of data for the same geographic region. One is presence-absence data of species (for amphibians, reptiles and birds) and the other has several environmental variables for the same ...
1
vote
2answers
5k views

Bhattacharyya distance for histograms

One of the ways to measure the similarity of two discrete probability distributions is the Bhattacharyya distance. In computer vision, for example, it is used to evaluate the degree of similarity ...
4
votes
1answer
4k views

Why use the Mahalanobis distance

I understand in theory why the Mahalanobis distance is a good measure for mutlivariate outlier detection. However, everything I tend to read warns against calculating the inverse/pseudoinverse of a ...
1
vote
1answer
2k views

Multidimensional scaling on distance or similarity matrix

Why doesn't the scatter plot change when I perform multidimensional scaling on distance or similarity matrix? This figure uses similarity matrix And this figure use distance matrix (sqrt(1-...
1
vote
1answer
1k views

How to calculate the HHG (Heller Heller Gorfine) distance in R

In looking at this question and investigating some recent developments in measuring correlation, I came across the HHG (Heller Heller Gorfine) test. Heller et al. promote it as superior to the ...
4
votes
1answer
1k views

How to convert a dendrogram back into a distance matrix?

Example code: our_dist <- dist(USArrests[1:4,]) dend <- as.dendrogram(hclust(our_dist , "ave")) plot(dend ) I would now wish to have a "dend2dist" function ...
7
votes
1answer
6k views

How is the distance formula related to the formula for standard deviation

The formula for the standard deviation of n numbers is the same as the formula for the distance between two points in n dimensions. Could someone explain why this is and how these are related?
1
vote
1answer
125 views

Finding an appropriate distance/divergence/similarity measure in a real 2D phase space

At first, I have to excuse my sloppy terminology, as I am pretty new to the whole topic. Imagine a real twodimensional phase space representing climate-related properties. I have a set of N variables ...
1
vote
1answer
1k views

KL divergence or similar “distance” metric between two multivariate distributions

I have a large dataset composed of many samples; each sample is as follows: imagine a grid indexed by i,j for a sample k, I have Y_k, where Y_k(i,j) is the probability density for k at (i,j) of ...
8
votes
1answer
2k views

What are the use cases related to cluster analysis of different distance metrics?

I'm trying to use different distance metrics like Euclidean, Manhattan, cosine, chebyshev among other distance metrics in my k-means algorithm to calculate distances between the data points and the ...
4
votes
0answers
100 views

Is there any way to define a distance metric given a Hidden Markov Model?

Let's say I've gotten a HMM that describes user search strings for my e-commerce website. Let's also say that I've just received a search string from a customer that doesn't have any search results. ...
1
vote
1answer
1k views

Does Mahalanobis distances have “significance” associated with them?

I have a "distance matrix". let's say a 6x6 distance matrix, each cell is the Mahalanobis distance of two "clusters" (or sets/groups of things in a multidimensional space), I want to "count" the ...
2
votes
1answer
2k views

Cluster analysis with skewed distibutions

For my master's thesis I would like to use different clustering algorithms to cluster municipalities (as objects) in regard to their land-use characteristics (as variables). Analyzing my data ...
1
vote
2answers
252 views

kNN search using distance fitted to a training set of similar pairs

I want to perform k-nearest neighbor search in multidimensional space but not using for example L2 distance but I want user to specify some "similar" pairs-examples and then perform search using this ...
2
votes
0answers
130 views

The product distribution: how fast does dissimilarity increase as a function of number of samples?

If $\mathcal{D}$ is a distribution, let $\mathcal{D}^n$ denote the $n$-fold Cartesian product of $\mathcal{D}$. In other words, $\mathcal{D}^n$ is the distribution of $n$-tuples $(x_1,\dots,x_n)$ ...
6
votes
3answers
3k views

Mahalanobis Distance on Singular Data

I have an issue which I could not solve, although I tried and I got some help on R forum. I am trying to calculate Mahalanobis ...
3
votes
2answers
158 views

Is concept of similarity objective?

Imagine following example: We have two pairs of points (i.e. 4 objects in some space) and two similarity measures. According to first similarity measure, objects from first pair are more similar then ...
5
votes
0answers
189 views

Joint distribution of two distances

Suppose there are three points in 3D space, each with coordinates $A_i=(X_i,Y_i,Z_i)\leadsto \mathcal{N}(\mu_i,\tau^2\mathbb{I}_3)$. We compute the distance between the three points, e.g. $D_{ij} = \|...
6
votes
1answer
8k views

K-means Mahalanobis vs Euclidean distance

I currently am trying to cluster "types" of changes on bitemporal multispectral satellite images. I applied a thing called a mad transform to both images, 5000 x 5000 pixels x 5 bands. Each band is a ...
2
votes
2answers
3k views

Can the covariance matrix in Mahalanobis distance definition be zero?

The statistical distance or Mahalanobis distance between two points $x = (x_1,\dots,x_p)'$ and $y = (y_1,\dots,y_p)'$ in the $p$-dimensional space $\mathbb R^p$ is defined as $$d(x, y) = \sqrt{ (x-y)' ...
28
votes
1answer
17k views

Converting similarity matrix to (euclidean) distance matrix

In Random forest algorithm, Breiman (author) constructs similarity matrix as follows: Send all learning examples down each tree in the forest If two examples land in the same leaf increment ...
12
votes
2answers
3k views

What is the distance between a finite Gaussian mixture and a Gaussian?

Suppose I have a mixture of finitely many Gaussians with known weights, means, and standard deviations. The means are not equal. The mean and standard deviation of the mixture can be calculated, of ...
3
votes
2answers
1k views

(hierarchical) cluster analysis with non-standard distance

My question is triggered by a question that was asked on stackoverflow: https://stackoverflow.com/questions/12198115/using-different-metric-for-hclust-linkage. The thing is this: I can formulate an ...
3
votes
1answer
30k views

How to calculate Mahalanobis distance in SPSS for an exploratory factor analysis?

I have a question regarding data screening for an exploratory factor analysis (EFA). I am conducting an EFA to identify the factor structure of 20 questions that I created on the topic of ...
2
votes
2answers
2k views

Specifying the number of clusters in nearest neighbor clustering

I've got a distance matrix between examples. I want to cluster them into m clusters with a nearest neighbor algorithm which works like this: ...
26
votes
1answer
1k views

Can the Mantel test be extended to asymmetric matrices?

The Mantel test is usually applied to symmetric distance/difference matrices. As far as I understand, an assumption of the test is that the measure used to define differences must be at least a semi-...
3
votes
0answers
323 views

Correct variance for minimum detectable difference

I have a question regarding variance, paired testing and minimum detectable difference (MDD). Paired samples: $$ MDD (δ) = \sqrt{ \frac{σ^2}{n} (t_{(α/2,n-1)} + t_{(1-β, n-1)})} $$ I have a set of ...
1
vote
0answers
169 views

$\chi^2$ distance and multivariate gaussian distribution [duplicate]

I want to know how to write the $\chi^{2}$ distance between two multivariate Gaussian distributions $f$ and $g$ in terms of their parameters only. The parameters of $f$ is the vector $\mu_{1}$ and a ...
3
votes
0answers
280 views

Comparing model fit with heteroscedastic data

I am developing a physiological test using R that requires some parameters optimised. In comparing the new method against the existing method, the values of individual readings correlate in a linear ...
24
votes
8answers
24k views

Perform K-means (or its close kin) clustering with only a distance matrix, not points-by-features data

I want to perform K-means clustering on objects I have, but the objects aren't described as points in space, i.e. by objects x features dataset. However, I am able ...
7
votes
4answers
10k views

Pairwise Mahalanobis distance in R [duplicate]

I'm trying to calculate a Mahalanobis-type pairwise distance matrix in R. I have 33 individuals, each with 10 variables. The idea is to get a distance matrix D, where $$D_{i,j}=(\mathbf{X}_i-\mathbf{...
2
votes
0answers
8k views

Distance threshold for clustering

Usually online clustering methods (based on kmeans or not) define a distance threshold value. If a new data-point $x$ is far enough from the nearest center $c$ (i.e. the distance from $x$ to $c$ is ...
5
votes
0answers
622 views

AIC with Mantel's tests

Mantel's tests are commonly used to compare genetic distances (say, between a number of individuals) with true or hypothesized landscape distances between those same individuals. For example, “does ...
-1
votes
1answer
2k views

Distance between two points with covariance [duplicate]

I would like to find the distance between two points location 1 and location 2. In 2D, location 1 is represented by a Gaussian distribution with mean $\mu_1$ and co-variance matrix $\Sigma_1$. ...
1
vote
3answers
8k views

Using a cosine similarity does not work for any dataset

I have a clustering algorithm, where if I use an euclidian distance as similarity, it works well on any dataset. If I replace it by a cosine similarity (see my code bellow), it will give a degenerate ...
3
votes
0answers
405 views

Similarity measure for weighted sets (multisets)

I have to compute a similarity measure between different sets (Actually they are more like maps than sets). A weight is associated to each element of the set. The sets I want to compare represent ...
2
votes
0answers
2k views

What is the distribution of the euclidean distance between two random points in 2d space?

I would like to know the distribution of z as the euclidean distance between 2 points which are not centred in the origin. If I assume 2 points in the 2D plane $A = (X_a,Y_a)$ and $B = (X_b,Y_b)$, ...
10
votes
0answers
4k views

How to compare two distance matrices?

Suppose that I have two distance matrices for the same set of items. By a distance matrix I mean a square matrix whose (i,j)th entry holds the distance (in terms of cosine similarity) between ith and ...
2
votes
0answers
290 views

Use of autoregressive metric for ARIMA clustering and analysis

I wonder if anyone has put into use the autoregressive metric for ARIMA clustering proposed by Corduas and Piccolo (2008). The authors define the distance autoregressive metric between two processes $...
7
votes
3answers
7k 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 ...
9
votes
2answers
4k views

Probability that uniformly random points in a rectangle have Euclidean distance less than a given threshold

Assume we have $n$ points in a rectangular with bound $[0,a] \times [0,b]$, and these points are uniformly distributed in this plane. (I am not quite familiar with statistics, so I don't know the ...
0
votes
1answer
2k views

Mahalanobis distance for vector-classification

B"H Hello, Assume I have a very large set of vectors ($X_i$) over some feature space ($F_i$), each vector is labeled as either $+1$ or $-1$. For convenience lets refer to this set as "the history ...
5
votes
2answers
15k views

Gower's (dis)similarity index

I would like to ask a question about Gower similarity/dissimilarity index. Is it ok to use the Gower dissimilarity measure with Ward linkage clustering? I was reading that the Gower similarity index ...
8
votes
3answers
2k views

Distance metric and curse of dimensions

Some where I read a note that if you have many parameters $(x_1, x_2, \ldots, x_n)$ and you try to find a "similarity metric" between these vectors, you may have a "curse of dimensioality". I believe ...
21
votes
1answer
5k views

Link between variance and pairwise distances within a variable

Please, prove that if we have two variables (equal sample size) $X$ and $Y$ and the variance in $X$ is greater than in $Y$, then the sum of squared differences (i.e., squared Euclidean distances) ...
2
votes
2answers
2k views

Can I use log-likelihood distance on data of only continuous variables?

I have to run a SPSS two-step cluster analysis. All my 4 variables are continuous scalar standardized parameters (with normal distribution). The dataset includes 10,000 cases. SPSS suggest to use ...
5
votes
4answers
1k views

Simple distance measure for financial time series

I have a large quantity of financial trading systems that I believe are highly duplicative, meaning that I believe a large number of the trading systems are essentially the same thing. I am looking ...
6
votes
1answer
3k views

Clustering with some cluster centers fixed/known

Thanks for reading my question. I have several thousand data points scattered on an (x,y) grid that I am trying to cluster. The data points are not uniformly distributed across the grid, but are ...
10
votes
4answers
3k views

Clustering with asymmetrical distance measures

How do you cluster a feature with an asymmetrical distance measure? For example, let's say you are clustering a dataset with days of the week as a feature - the distance from Monday to Friday is not ...
3
votes
2answers
845 views

Difference between Hausdorff and earth mover (EMD) distance

I have two dataset that i want to compare. each dataset contain the weight of 10 different person measured for 3 different day. I am interested in measuring the probabily that the two sample ...