Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [distance]

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

2
votes
0answers
19 views

Distance/Metric between two regression models?

I wonder if there is any theory or work about the "similarity" of two regression models. For example, if it is linear regression, the "similarity" could be defined by the l-2 distance between the ...
1
vote
0answers
23 views

Distribution of distance between positions

I have N = 3 billion ordered positions, as in a genome that has 3 billion base pairs. I have R = 3 million, as in 3 million SNPs (Single Nucleotide Polymorphisms) that are (close to) randomly ...
0
votes
0answers
3 views

Distance based Spatial sampling

I am struggling with spatial sampling of data which has Latitude & Longitude for data points. I need to do sampling such that no adjacent or nearby point should get selected ( Need to give some ...
0
votes
0answers
21 views

Is euclidean distance in pca rotated and scaled when $n < p$ the same for all observations?

I am trying to come up with an appropriate measure of the 'distance to the normal mean' in high dimensional space and I came up with a strange result, and I need some theoretical background to ...
0
votes
1answer
19 views

How can K-Means clustering work without spatial information?

Just got stuck at working with K-means clustering. I have looked up this python/skimage commands: ...
0
votes
0answers
11 views

Manipulation of asymptotic bounds for distance between estimators

Suppose I know some asymptotic bounds: $$\mathbb{E}(|D(a,\hat{a})|) \lesssim O(n^{-1/2}),$$ where $D$ is some distance between probability measures, and $a$ is a probability measure while $\hat{a}$ ...
0
votes
0answers
30 views

Distance between point process realizations

Is there a valid distance metric for measuring how similar are the realisations of two point processes? E.g. let's say we simulate two histories $ h_1, h_2 $ in the time interval $ [0, T] $ for two ...
0
votes
0answers
37 views

Dot Product and Distance Matrix

If we want to calculate the squared distance between 2 vectors, $x$ and $y$, we use the dot product: $$||x-y||^2 = (x-y)(x-y)^T = xx^T - 2xy + yy^T$$ The question is, how to generalize this concept ...
0
votes
0answers
21 views

Inferences about leverage score and Mahalanobis distance

I have some inference given below: Given the design matrix $\textbf{X}$, the leverage score is defined as $\textbf{H}_{ii}$ where $\textbf{H} = \textbf{X} (\textbf{X}^T \textbf{X})^{-1} \textbf{X}^T$ ...
1
vote
0answers
53 views

Hierarchical clustering dendrogram on a distance matrix

When computing hierarchical clustering over a data matrix, a dissimilarity matrix is first computed in order to build the tree (dendrogram). For example: ...
3
votes
1answer
62 views

Explaining the difference between Pearson correlation and distance correlation

This question and its answer might highlight my naivete regarding Brownian/distance correlation. I'm using the difference between a matrix of distance correlations, as calculated by ...
0
votes
0answers
32 views

Gower Distance and PAM algorithm with Random Forest for Variable Selection

I am currently working with cluster analysis and am trying to create clusters based on the important variables. My data consists of both categorical and continuous variables thus I have used the ...
0
votes
1answer
71 views

What is Intraclass Distance?

For an assignment I have to compute the intra-class distance and use it as an objective function to select features. This is for the MNIST dataset. While I have a fairly good handle on other aspects ...
1
vote
0answers
15 views

R daisy - Gower distance, different values with different number of observations [duplicate]

I have a mixed data set where I want to compute distances between observations with Gower in R (daisy function). When I compute distances between different number of observations, the distances seem ...
0
votes
1answer
47 views

How is Student's t-distribution related with this similarity/probability equation between data points?

In the t-SNE paper "Visualizing Data using t-SNE" and a Deep Embedded Clustering (DEC) approach "Unsupervised Deep Embedding for Clustering Analysis", they both use the Student t-distribution to ...
0
votes
0answers
4 views

Similarity between observations and an ideal trend

I have a series of well known data showing, for example, the average weight by age in Europe. Let's say yesterday I called a lot of people and I asked for their age and weight. The data coming from ...
1
vote
2answers
107 views

For calculating the distance between different points, does it make sense to use all Principal Components?

I have a data frame with about 500 observations and 8 variables that I'd like to run through PCA in order to try and reduce the number of variables to only those with the most variance. From here, I ...
2
votes
0answers
50 views

Are there distance-based models that can include a random effect?

Distance-based linear models, such as those implemented by the adonis package in R, allow us to fit one or more predictors to a multivariate response represented by ...
0
votes
0answers
21 views

Training a classifier with just a subset of labelled classes

I have a problem space in which there are tens of different classes but we only have some labelled data of just a few of those classes. The classifier should predict the class of those it knows (i.e. ...
2
votes
1answer
131 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
vote
0answers
72 views

KL divergence between sample and true (multivariate normal) distribution

I was wondering, whether there is a possible interpretation of the KL-Divergence between sample and true distribution in terms of probabilities. E.g. given $P=\mathcal{N}\left(\mu,\Sigma\right)$ and $...
2
votes
1answer
37 views

$L_2$ norm of product of two vectors

Let's assume we have two matrices $A^{d\times 1}$ and $B^{1 \times e}$, and we define their product as $C^{d\times e}$. Assuming $A,B$ are real valued with all entries in $[-1,1]$. I can intuitively ...
0
votes
0answers
6 views

BGSS for non-euclidean distance matrices

How to compute BGSS without the concept of centroid or barycentre where only a distance matrix is available and not the original data points? For non-euclidean distances, TSS (total sum of squares) = ...
2
votes
1answer
44 views

Distance metric with characteristics of cosine and Manhattan

I'm working on a project where I want to find similarities between groups of events. So far I have expressed groups of events as vectors of event counts and computing similarities between them. I'm ...
0
votes
0answers
18 views

Class frequency comparison (exponential distribution)

I have two different sources of data and I would like to check if their class distributions are similar and how much. The first dataset ($D_1$) has 2M samples and the second ($D_2$) 6M. When I ...
2
votes
2answers
31 views

Localized distance function on sequential binary data

I am trying to find a good distance function for sequential data that is all binary. For now, I am using Edit distance however I have some more domain-specific knowledge that I would like to ...
0
votes
1answer
20 views

How bregman divergence gives optimal solution for cluster assignment?

Can somebody gives intuition behind Bregman divergences that how using it leads to optimal cluster representation? And why using ...
0
votes
1answer
22 views

Euclidean distances in spaces of different dimensions

A modest attempt to illustrate my question: Setup Consider a survey where you have to choose if you like to do an activity or not. You do this for a number of activities $A_1,...,A_8$. In addition, ...
-1
votes
1answer
32 views

How to cluster a (directional) dissimilarity matrix with both positive and negative values?

I may be thinking of this incorrectly but what would be the best way to cluster a dissimilarity measure that has direction? For example, if someone had condition A ...
0
votes
0answers
83 views

Is there any intuition behind the writing Jensen-Shannon divergence based on the entropy?

I know that Jensen-Shannon divergence between two distribution $P$ and $Q$ can be written as follow: $JS(P||Q) = H(\frac{P+Q}{2}) - \frac{H(P)}{2} - \frac{H(Q)}{2}$ But is there any intuition behind ...
2
votes
0answers
30 views

Computing Wassertein Distance

For two probability measures $\mu$ and $\nu$, the Wassertein Distance is defined as $$W_p (\mu , \nu) = \left[ \inf\limits_{\gamma \in \Gamma} |x-y|^p \, d\gamma (x,y) \right] ^{\frac{1}{p}} \, , $$ ...
0
votes
1answer
36 views

R: What is the distance function equivalent for this formula?

Hi I'm using an R package that calculates distance with this formula here, as.dist(1 - cor(df, use = "pa")) However I cannot seem to find an equivalent dist ...
1
vote
0answers
38 views

How to localize points from an incomplete distance matrix in R?

Suppose you have 3 shops and 2 supply units, and you only know the 6 pairwise (Euclidean, assuming 2D) distances between each shop and each supply unit, but not the pairwise distances between the ...
0
votes
0answers
3 views

Quick search based on similarity: logarithmic time

I have some objects $x\in X$ and a metric $s:X\times X\to\mathbb{R_{+}}$. For each $x$, there is a $y\in Y$. Note that $x$ and $y$ are highly structured and we cannot consider neural networks for ...
0
votes
0answers
8 views

Calculate association trends

I have time series dataset for 10 consecutive periods (i.e. T, T+1, T+2, ..., T+9). Moreover, I also have 100 term triplets in each time period. Each triplet contains 3 objects namely x, y and z. I ...
3
votes
1answer
93 views

Calculation of relative distance

I have 100 term triplets as shown in the below mentioned figure. Each triplet contains 3 objects namely x, y and z. I want to rank the triplets according to the following two properties. y should be ...
1
vote
1answer
105 views

Mahalanobis distance gives counterintuitive results [closed]

I have generated 100 sample time series, each 24 items long, and each with an exponential distribution with a different scale for each of the 24 time points. This is the scale parameter per time point:...
3
votes
1answer
54 views

Basic Hellinger Distance

One definition of Hellinger Distance is $$L_{H}: (1/2) E_{\theta}([\sqrt{\frac{f(x|\delta)}{f(x|\theta)}}-1])^{2}$$ My book has that for $x \sim N(\theta,1)$ $$L_{H}(\theta,\delta)=1-\exp(-(1/8)(\...
1
vote
0answers
99 views

Mahalanobis distance between 2 points doesn't work when covariance matrix has values close to 0

I am working on a project where I am trying to replicate a randomized experiment from an observational study data, using Mahalanobis distance matching to ensure that the control and treated groups are ...
2
votes
1answer
174 views

How can I order kmeans clusters?

I have a kmeans cluster object and I would like to order the clusters. Not the observations within the clusters, rather the clusters in order of each other. Is there a way of doing this? I found ...
0
votes
1answer
27 views

Kmeans results, is the cluster vector ordered by 'closeness"?

I ran kmeans in r with k = 20 centers and 7 scaled variables to cluster with on a data frame with n = 100K. Using dplyr group_by I was able to view summary data for each of the 20 clusters: the mean ...
-1
votes
1answer
210 views

How k-means computes cluster centroids differently for each distance metric?

K-means computes cluster centroids differently for each distance metric. I don't know why the way of computing the centroid is dependent of the distance measure. I don't know how we compute the ...
0
votes
0answers
16 views

Robust distance measure for correlated data

I read a paper in which the authors want to compare the overall predictive accuracy of various predictors on a set of variables by using the Mahalanobis-Distance. However the data is not even ...
3
votes
2answers
320 views
0
votes
1answer
26 views

Clustering by same random projection

I have $N$, $1024$-dimensional vectors. I want to cluster them by some similarity. Given the high dimensionality, standard metrics won't work. I tried a few Approximate Nearest Neighbor ...
1
vote
0answers
93 views

Compare KS test and Wasserstein distance or Earth mover's distance

Consider two sets of data points A and B. Both these data points are from mixture of unknown number of Gaussians. The mean of the Gaussians are little different for each set (there may have few ...
0
votes
0answers
21 views

Comparison of empirical discrete distributions. Pros and cons of different metrics?

I am trying to measure the dissimilarity between two empirical discrete distributions. I am aware of various distance metrics that could be used for this purpose such as Wasserstein, Bhattacharyya etc....
1
vote
0answers
19 views

Mean distance from the centre to any point in a sphere and a cylinder [closed]

What is the mean distance from the centre to any point within a sphere of radius r? What is the mean distance from the centre to any point within a cylinder of radius r and length l?
0
votes
0answers
45 views

How to quantify distance between 2 datasets?

I have a distribution $A$ (intent-to-treat population) and its subset $B \subset A$ (treated population). I learn a propensity model $P(x \in B)$ to predict treatment. Then I sample the intent-to-...
1
vote
0answers
49 views

Distance between angle distributions

I want to quantify the complexity of the street network of different cities. For each city I have the angle distribution of its streets. My hypothesis that the more complex the street network, the ...