Distance functions refer to functions used for quantifying the notion of distance between members of a set, or between objects.

learn more… | top users | synonyms

0
votes
0answers
14 views

How to split a class which is not very cohesive?

Using the silhouette width metric I can find out as to how well each object lies within its class after classification is done. I next find the average silhouette width of objects within a class and ...
2
votes
1answer
41 views

Distances for binary and non binary categorical data

I am computing a matrix of distances for categorical data. I am using the Jaccard distance since as far as I understood it should be working properly with this kind of data. I have BOTH binary and ...
1
vote
1answer
21 views

Using Mantel to explore relationship between geographic distance and a multivariate character

I'm working with bird songs. A song is composed of many vocal parameters [highest frequency (Hz), lower frequency(Hz), bandwidth(Hz), duration (s), number of notes, and son on....] I'm interested in ...
0
votes
1answer
19 views

Mantel Test data assumptions

Does the Mantel Test works with non-normal distributed samples? I couldn't find anything clear enough about it.
1
vote
0answers
18 views

How do you deal with different distance based features?

If I have a model where the set of features where a cosign distance measure makes sense for some of the features, and a Euclidean distance measure makes sense for the others for example using a BOW ...
0
votes
1answer
22 views

Order of Matrix Operations in Mahalanobis Calculations

I'm teaching myself to translate equations to code after many years of letting my math skills atrophy, and am trying to do it on my own as much as possible. I've run into a couple of difficult ...
0
votes
0answers
42 views

Using relative frequency for Euclidean and cosine distance (dissimilarity)

How to calculate the Euclidean distance (dissimilarity) between two documents, e.g., D1 and D2 using relative frequency? Here is an example of both cosine and Euclidean distance between two ...
0
votes
0answers
27 views

Multidimensional Scaling: Interpreting output of different distance matrices (Euclidean or correlation)

I would like to understand the difference between using a Euclidean distance matrix or correlation matrix as input to a nMDS algorithm. I have completed MDS plots of both, and while similar, the ...
1
vote
0answers
14 views

Distribution of altered Mahalanobis distance [duplicate]

Let's say I have a set of i.i.d. samples $X_1,\ldots,X_N \sim N_p(\mu, \Sigma)$. Now define \begin{equation} d^2_i(b)=(X_i - b)'\Sigma^{-1}(X_i-b) \end{equation} which is essentially the Mahalanobis ...
1
vote
1answer
52 views

How to choose the right distance matrix for clustering?

I am attempting simple Ward type clustering. However, the R package is proving several choices to use for the distance matrix. I am wondering how I am supposed to determine the right distance matrix ...
1
vote
1answer
60 views

Distance between two random vectors

I have two random vectors, $A$ and $B$ with each consisting of $n$ geographical co-ordinates $(x_1,y_1),(x_2,y_2)\dots (x_n,y_n)$ and $(\tilde{x}_1,\tilde{y}_1),(\tilde{x}_2,\tilde{y}_2)\dots ...
0
votes
1answer
111 views

hclust, R and Euclidean distances: weird stuff

I have a table of similarities expressed through cosines and am trying to do some cluster analysis in R, using hclust and ...
1
vote
1answer
91 views

Cook's Distance

The formula of Cook's distance is $$D_i=\frac{(\hat Y-\hat Y(i))^{\prime}(\hat Y-\hat Y(i))}{p\times MSE}$$ where, $\hat Y$ is the prediction from the full regression model and $\hat Y$ is a ...
0
votes
1answer
40 views

advantage of euclidean distance for classification

Has euclidean distance any advantage in compare to another distance based methods like Manhatan distance or Maximum difference metric?
11
votes
3answers
489 views

Do the pdf and the pmf and the cdf contain the same information?

Do the pdf and the pmf and the cdf contain the same information? For me the pdf gives the whole probability to a certain point(basically the area under the probability). The pmf give the probability ...
2
votes
1answer
52 views

Jeffries Matusita distance for 14 variables

I wish to perform Jeffries-Matusita distance on 14 spectral bands. Is there anyone who can help with how it is done in R? Thank you.
4
votes
1answer
167 views

How to distance and to MDS-plot objects according their complex shape

Suppose I have four basal forms of signal (blue, purple, red, green). I also have created transition forms between each other. If you carefully look on the picture below, you can see that for example ...
1
vote
0answers
26 views

Representing a distance matrix in the plane [duplicate]

I've worked with observations as vectors with both continuous and categorical variables. In both cases one can use dimensionality reduction techniques such as PCA (in the latter case through ...
0
votes
0answers
28 views

Log likelihood - understand depper

I want to use log likelihood formula to relate between two items. The formula is: LLR = 2 sum(k) (H(k) - H(rowSums(k)) - H(colSums(k))) When this is the table: ...
2
votes
0answers
27 views

Way to Measure Groupings Using Distances Between Individuals?

I am working on a problem that requires me to measure groupings of people. I have the location of every individual in my sample at every point in time. It's therefore trivial to calculate the ...
2
votes
0answers
43 views

What is a good similarity measure to use when missing data is a significant issue?

I have a list of cities that I want to compare in terms of their similarity. Each city can described by a large but finite number of characteristics but most of them will have missing data for some ...
2
votes
0answers
27 views

Calculate number of standard deviations separating two multivariate Gaussians?

Given a set of multivariate Gaussian distributions (from fitting a Gaussian mixture model) I would like to be able to calculate the likelihood that a data point drawn from one Gaussian will improperly ...
0
votes
0answers
27 views

Histogram distance metric for extreme values only

I am interested in a histogram comparison method or histogram matching technique that takes into account only the tails of the distribution. Consider the following histograms: Histogram 1: ...
1
vote
1answer
27 views

calculate Levenshtein Distance for web click stream data

I want to calculate Levenshtein Distance between to web click paths. I have a web page list around 500. ...
1
vote
0answers
43 views

How does Gower distance work with free text?

The Gower distance measure is a good measure for mixed-type data (i.e., data attributes can be qualitative, categorical, ordinal or binary). But can data attributes be free-text (e.g., names of ...
0
votes
1answer
47 views

What is the $p$ in Cook's distance?

In the equation for Cook's distance: $$D_i = \frac{\sum_{j=1}^{n}(\hat{y}_j - \hat{y}_{j(i)})^2}{p MSE}$$ the value of $p$ is defined as "the number of fitted parameters in the model." What does ...
60
votes
6answers
6k views

Why is Euclidean distance not a good metric in high dimensions?

I read that 'Euclidean distance is not a good distance in high dimensions'. I guess this statement has something to do with the curse of dimensionality, but what exactly? Besides, what is 'high ...
0
votes
2answers
50 views

Is this a valid use case for Euclidean distance?

I have a set of points which is a count of links that users have clicked on : ...
0
votes
0answers
60 views

Negative Mahalanobis Distance

I would like to calculate a compound scores of several normal distributed continues standardized (z-score) variables. Some of these measures are correlated, some are not. Hence, I would like to take ...
2
votes
2answers
131 views

Building the connection between cosine similarity and correlation in R

According to some articles (e.g. here) correlation is just a centered version of cosine similarity. I use the following code to calculate the cosine similarity matrix of the column vectors of a matrix ...
3
votes
0answers
27 views

Comparing two distributions in Fourier space

There exist a number of tools that provide a distance between two continuous probability distributions. Most (semi)distances, like the Kullback-Leibler divergence, use probability density functions. ...
0
votes
0answers
34 views

Distance between a transition matrix and an instance

I am trying to put a number to the distance of a sequence and how close it is to the original training corpus. From the original training data, I got a markov transition matrix (TM). So from the ...
4
votes
2answers
201 views

Is there an advantage to squaring dissimilarities when using Ward clustering?

Is there a reason to prefer squaring or not squaring the dissimilarities when clustering with Ward's method? The question is motivated by the following statement in the documentation for R's ...
0
votes
1answer
41 views

One huge cluster + small ones with vector-space model + cosine distance

I'm trying to cluster meaningfully a set of objects characterized by a vector space (bag-of-words) model. Each of those 5000 objects has 1-8 features ("words") from a set of 5500 possible. I used a ...
1
vote
0answers
44 views

Average minimum distance between two random vectors

Let $\mathbf{y_1} =\begin{bmatrix}g_1x_1 & g_2x_1 & \dots & g_Nx_1 \end{bmatrix}$ and $\mathbf{y_2} = \begin{bmatrix} f_1x_2 & f_2x_2 & \dots & f_Nx_2\end{bmatrix}$. All the ...
0
votes
1answer
50 views

Silhouette scores for different distance metrics

I clustered a data set using PAM with a euclidean distance metric and a pearson correlation distance metric. The average silhouette value of the correlation clusters is higher at most points than the ...
2
votes
0answers
48 views

What is a good technique for grouping objects based on binary or dichotomous traits?

I have a set of objects each of which has a list of traits. Data on the traits is binary: an object has a trait or does not. The number of objects that I have is moderately greater than the number ...
0
votes
0answers
18 views

Why inverse of the sample covariance matrix is used in Mahalanobis distance calculation? [duplicate]

The Mahalanobis distance of an observation vector $X$ from a set of observations is defined as $d=\sqrt{(\vec{x}-\vec{\mu})^T S^{-1} (\vec{x}-\vec{\mu})}$ where $S$ is the sample covariance matrix and ...
3
votes
0answers
65 views

Facebook users similarities

I'm searching for a similarity metric such that given two Facebook users it returns a value that reflects how similar the two users are. The similarity metrics must take into account (at the same ...
4
votes
0answers
137 views

Compute Shannon entropy between every row of a large, sparse matrix

I have a sparse, binary matrix of user (rows) and items (columns). Each element of this matrix is either 0 or 1: ...
0
votes
0answers
20 views

Estimation based Distance observations

Let $X_1,\dots,X_n$ are i.i.d. copies of $X$, however I don't know the value of them. I only know the distance for every pair $(i,j)$. Now, assume that we are given $Y$ and $Z$ which are also i.i.d. ...
2
votes
0answers
29 views

Metric optimization on discrete learning sample

There are a set of ("artifical") not Minkovski (triangle inequality is not guaranteed) metrics defined on set of objects. There are one etalon ("natural") metric, which estimation is known only for ...
0
votes
0answers
24 views

Dealing with Euclidean distance and dimension independence

I'm not very well informed in terms of distance measures. What sort of distance measure would I use if I know that the various dimensions are not independent of each other? Because I think that ...
0
votes
2answers
38 views

How to cluster users based on search terms

How to cluster based on what users are searching on I'm working on an app which includes search functionality: a search box that allows a user to enter text and search the entire site. I have access ...
1
vote
1answer
102 views

String clustering and centroid computation

I have a text file document containing a set of words strings that I want to cluster. I want to use the K-means algorithm. As a ...
2
votes
1answer
85 views

How to measure the distance (or divergence - not sure) between data and a probability distribution?

If I have generated a set of random data and I wish to measure how well these data fit, e.g. a uniform probability distribution, what are the standard ways to do that? I am not very experienced with ...
1
vote
1answer
50 views

Calculating (dis)similarity between different types of features

Disclaimer: I understand that this question is specific to the types of data, the end goal, etc. but I just wanted to get some quick tips regarding calculating dissimilarity between different types of ...
1
vote
0answers
27 views

Limitations of using interpolated data

I have a data set that is composed of point locations in a landscape, lets call this dataset X. Some of the points in data set X need to be grouped together because they "function" together as a ...
0
votes
1answer
174 views

distortion function for k-means algorithm

I was reading Andrew Ng's ML lecture notes on K-mean clustering, in which the distortion function is defined as follow $$J(c,\mu) = \sum^m_{i=1} || x^{(i)} - \mu_{c^{(i)}}||^2$$ I am puzzled about ...
3
votes
0answers
60 views

Similarity Amongst Recipes Using Ingredients and Reviews/Descriptions

I'm still toying with things and just learning this, so please forgive any incorrect terminology. My toy data set is a collection of recipes with a fairly significant overlap in ingredients. I'm ...