Questions tagged [mahalanobis]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7
votes
2answers
1k views

Is there a version of the Mahalanobis distance for matrices?

I'm working on a computer vision problem and I want to use the Mahalanobis distance to cluster image patches (2D matrices having the same dimensions). I haven't been able to find any generalisation up ...
6
votes
2answers
242 views

Something like Mahalanobis distance when the copula is not Gaussian

Mahalanobis distance accounts for different variances of the marginal variables and correlations between the marginal variables. However, there is an implicit (maybe explicit) assumption that ...
3
votes
2answers
1k views

What are the pros and cons of using mahalanobis distance instead of propensity scores in matching

I learned about this option of using mahalanobis distance instead of PS to do matching from the matchit() function in R. It seems a more nonparametric approach. Could you state its pros and cons and ...
2
votes
3answers
183 views

How to find the variance(s) of a bivariate normal density such that 95% of the mass is within a certain radius from the mean defined by a point A?

I would like to find the variance of a bivariate normal density (BND), centered at the mean M, such that 95% of its mass is within a certain radius, which depends on the position of a point, A. (Note: ...
2
votes
1answer
107 views

Why does this formula produce $p_{2}$ probabilities for Mahalanobis distances?

At the IBM website it is written that The p1 probabilities are standard probabilities of an observation from a multivariate normal distribution being that far or further from the centroid, ...
2
votes
2answers
887 views

Understanding the R stats mahalanobis() function's Output

An acquaintance recommended I use the Mahalanobis distance on my data instead of Euclidean, Manhattan, etc. I tried using the mahalanobis() function in the R stats package on a data matrix with N ...
2
votes
1answer
55 views

How to determine an appropriate "closeness" threshold when matching for causal inference?

Say I have a [yes/no] treatment variable (e.g. the customer complained about their order) and I want to estimate the causal impact of this "treatment" on the average customer's future spend. ...
2
votes
2answers
6k views

Mahalanobis Distances Critical Values (Chi-Squared?)

Say I work out the mahalanobis distance 'D' to measure the separation between two objects (which aren't normally distributed). Say I now want to use 'D' against some critical values to decide if it's ...
2
votes
0answers
2k views

the Chi-squared distribution and Mahalanobis

I'm doing some simulations in C++ and OpenGL (2D and 3D) for navigating a robot in unknown environment known as SLAM. I'm using Extended Kalman filter as an optimal estimator. In SLAM problem, once ...
1
vote
1answer
25 views

Mahalanobis Distance question in r

I have a question when calculating Mahalanobis Distance using R. For the Mahalanobis distance function below: mahalanobis(x, center, cov, inverted = FALSE, ...) The center in the function above should ...
1
vote
1answer
48 views

Is there an intuition about the matrix operations in the exponent of the multivariate normal distribution?

In the exponent of the multivariate distribution, there are 2 vectors and a square matrix multiplied together to get a scalar result: $$(\mathbf{x} - \mu)^{\text{T}}\Gamma^{-1}(\mathbf{x} - \mu)$$ ...
1
vote
1answer
280 views

Anomaly detection using Mahalanobis distance

I am using Mahalanobis distance to identify outliers. I am training using kind of one class classification,by training only on positive samples and trying to predict negative samples using distance ...
1
vote
1answer
29 views

Detect outliers / detect classes

Currently I have a dataset that contains several products with different prices and quantities. My goal is to detect if the given product was sold as a package or as a unit and I have used the ...
1
vote
0answers
439 views

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

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 ...
1
vote
0answers
99 views

How can I use factor analysis to identify variables that contribute most to Mahalanobis distance?

I have 400 samples chemically analysed for 48 elements. Some elements are correlated. My goal is to identify outliers in a multivariate space, samples that are unique in their composition. I compute ...
1
vote
0answers
974 views

Distribution of the Mahalanobis distance between two samples from a Gaussian distribution

Let $\mathbf{X}=(X_1,\dots,X_p)\sim\mathcal{N}(\mu,\Sigma)$ be a Gaussian random vector. We all know that $$d^2(\mathbf{X},\mu) = (\mathbf{X}-\mu)^T\Sigma^{-1}(\mathbf{X}-\mu) $$ has a $\chi^2_p-$...
1
vote
0answers
953 views

assumptions to compute mahalanobis distance

Which are the assumptions to compute the Mahalanobis distance between two groups? Do all the variables of the two groups be normal distributed?
0
votes
1answer
44 views

When running a multiple regression, are both dependent and independent variables scanned for outliers?

I want to run a multiple regression analysis using SPSS. I have used the Mahalanobis d square method to find outliers. However my question is, do I add the dependent variable to the list of ...
0
votes
1answer
251 views

Mahalanobis Distance for Continuous and Ordinal Covariates

My dataset of home sales includes covariates such as square_feet which are continuous and others like num_bedrooms which are in <...
0
votes
1answer
84 views

Discordance between various methods of multivariate outliers detection

Here is a small "toy example" dataset, with 15 individuals described by 6 variables (this is R language): ...
0
votes
0answers
24 views

How to find 'influential points' in multivariate data with weak covariance

Part-1: I have used PCA and Mahalanobis distance to find outliers. But in both cases, only the highest or lowest values are detected as outliers. I am looking for a way that any data point that does ...
0
votes
0answers
14 views

Calculating Mahalanobis distance using SPSS

I am a doctoral student who is still learning programming and statistics. I am really struggling with a problem and need help from this community help in calculating a new variable using Mahalanobis ...
0
votes
0answers
27 views

Is negative Mahalanobis distance proportional to log probability?

Is the following statement true? I was sure it was, but I was told by someone else that it is not. $$ p(\mathbf{x}_i | y_i) = \frac{1}{2\pi^{\frac{D}{2}} |\mathbf{\Sigma}_c|^{\frac{1}{2}} } e^{ -\frac{...
0
votes
0answers
27 views

Mahalanobis distance?

I have a question regarding the use of the Mahalanobis distance as a measure of the goodness-of-fit of a bivariate Guassian pair. Let's assume that we have some theoretical relationship $$\bigg(\begin{...
0
votes
0answers
10 views

Alternative way of solving Mahalanobis distance

Mahalanobis distance is given by: $(x-\mu)^T \Sigma^{-1}(x-\mu)$ Apparently the solution to the above formula is equivalent to: $Trace(\Sigma^{-1} (x-\mu)(x-\mu)^T)$ How can you prove that the two are ...
0
votes
0answers
17 views

Contribution to Mahalanobis Distance

I am trying to figure out how to decompose Mahalanobis Distance into its marginal contributors on a granular level. I've already split it up into marginal contribution from each variable: $$ MD_i = ...
0
votes
0answers
14 views

Effect of correlation in matching

What is the effect of correlations among observed covariates or between observed and unobserved covariates on the quality of matching, when matching iss done using Propensity score (Euclidian/...
0
votes
0answers
24 views

Multivariate Statistics and Outlier Detection for Large Time Series of Physically Related Variables

The data: I have somewhat noisy time series measurements for 15 variables, with occasional flat-lining, offsets, outliers, clipping, etc. Some of the data quality issues are consistent enough to ...
0
votes
0answers
64 views

Mahalanobis distance to detect multivariate outliers [duplicate]

I have to detect outliers on 3 variables. On the internet I found the mahalanobis distance but I understood I can use it only on multivariate normally distributed data, and my data isn't. So, do you ...
0
votes
0answers
125 views

Covariance Matrix Decomposition - Data Decorrelation

So I recently found out about Mahalanobis distance. Given a r.v $x$ in N-dimensional space, an associated metric is defined by $$M(x) = \sqrt{(x-\mu)^T S^{-1}(x-\mu)}$$ where $\mu$ and $S$ are mean ...
0
votes
0answers
47 views

Equivalence between Mahalanobis distance and PCA (mathematical proof) [duplicate]

From this article and this post it emerges the strong connection between Mahalanobis distance and PCA. In particular in the first article I reference it says: " the squared Mahalanobis distance is ...