Talk:Mahalanobis distance

message: Statistical leverage links here.  Is that appropriate??  Seems to me the former concept is broader than this article.
— DIV (128.250.204.118 07:46, 9 July 2007 (UTC)
replies: text: Yes. There is a section for it Mahalanobis_distance#Relationship_to_leverage. Shyamal 09:29, 9 July 2007 (UTC)
replies: text: That section is very uninformative, as it doesn't explain what leverage is. Ideally it would be linked to a page on statistical leverage, but that page doesn't seem to exist. --84.9.85.135 12:21, 30 October 2007 (UTC)
replies: text: If someone creates the article it will be located at Leverage (statistics). ~MDD4696 20:10, 3 December 2007 (UTC)

text: Brief article now created at Leverage (statistics). Now changing entry on Leverage (disambiguation). Melcombe (talk) 11:07, 17 December 2008 (UTC)
thread_title: Leverage

message: That intuitive explanation was very helpful, great work. Matumio (talk) 09:34, 21 December 2007 (UTC)
replies: text: I totally agree! --Uliba (talk) 14:41, 21 April 2009 (UTC)
replies: text: The intuitive explanation is very well written.  Many other wikipedia articles would be much improved by a similar section. Ceoyoyo (talk) 21:11, 6 January 2010 (UTC)
replies: text:  Yeah I just came to the talk page to thank the person who wrote the intuitive explanation as well. Would be nice to be a standardized section name in Wikipedia maths articles. 81.133.20.197 (talk) 14:01, 15 August 2012 (UTC)
replies: text: Fully agree with the above remarks. Sources are more or less irrelevant to this section. If there has to be one, then the it should be the author of this excellently cogent explanation Lawrence Normie (talk) 11:47, 7 July 2022 (UTC)
thread_title: Intuitive explanation

message: The covariance matrix is usually called \Sigma rather than P. It hampers readability. I am changing it unless there is a specific reason for calling it P. Sourangshu (talk) 13:34, 25 February 2008 (UTC)
replies: text: I have changed the text in the third paragraph. The covariance matrix was called there \Rho, instead of \Sigma. Now the paragraph is consistent with formula (2). Rlopez (talk) 13:25, 17 June 2008 (UTC)

text: Maybe I do not understand what you mean, but in covariance \Sigma is never used. The notation used there is Cov(). --Pot (talk) 08:08, 14 March 2009 (UTC)
replies: text: I don't think it is moot. I believe that strictly speaking a "Mahalanobis distance" in its original meaning was defined for a sample covariance and was defined for the purpose of being a distance between samples from two populations. Melcombe (talk) 15:43, 18 September 2009 (UTC)
thread_title: Covariance matrix symbol

message: Adding Template:Refimprove banner. 
I recently added the main reference to Mahalanobis, 1936, but I just noticed it had been previously removed for some obscure reason (this article obviously exist, even if it is hard to find (you need to register to the journal).
More generally, this article is insufficiently sourced. Intuitive explanation and Relationship to leverage should have at least 1 reference each. Each application should be referenced. Calimo (talk) 09:57, 7 December 2008 (UTC)
replies: text: Requesting references for specific claims using Template:Fact. Challenged material may be removed in a few months. Calimo (talk) 10:08, 15 December 2008 (UTC)
replies: text: Please don't. That would be rude. See discussion below. linas (talk) 03:48, 17 December 2008 (UTC)
thread_title: References

message: Suppose I have two uncorrelated 2D points with zero mean but with different variance, x and y. Suppose 
: cov(x) = diag(1,10) 
and 
: cov(y) = diag(10,1)
As I understand Mahalanobis distance, If I had x=[0.1,1] it would have a Mahalanobis distance of 0.1414 from the origin. Likewise if y=[1,0.1] it would have a Mahalanobis distance of 0.1414 from the origin (would that be a "Mahalobis norm"?) but y=[0.1,1] would have a Mahalobis distance of 1.0 from the origin.
What is the Mahalanobis distance between a given x and y? My feeling is that this intuitively measures the unlikelyhood of the distance between x and y. As such, it should have something to do with the expected value of x-y. Any thoughts?
In particular, I'm guessing that we can let z=x-y and use the sum of normally distributed random variables rules to find that
: Z ~ N(0, \operatorname{diag}(1,10)^2 + \operatorname{diag}(10,1)^2) = N(0,\operatorname{diag}(101,101))
and so the Mahalanobis distance between x and y would be 
: d_M(x,y) = D_M(z) = \sqrt{(x-y)^T \operatorname{diag}\left(\frac{1}{101},\frac{1}{101}\right) (x-y)}.
Does that sound right? —Ben FrantzDale (talk) 18:02, 30 March 2009 (UTC)
replies: text: Looking back at this, I think there's a missing factor of 1/2 under the radical since this should degenerate to the given definition for Mahalanobis distance in the case that the variances are equal. —Ben FrantzDale (talk) 18:11, 30 March 2009 (UTC)
thread_title:  Differing variances? 

message: I'm not editing the page, because I don't know if it's _true_ or not. But, this page http://www.aiaccess.net/English/Glossaries/GlosMod/e_gm_mahalanobis.htm claims that the distribution of the mahalanobis distance squared is the chi square distribution with p degrees of freedom. Is this so? (I've experimentally tried it, and the values seem to work, but I know enough to know that that doesn't necessarily prove anything...) If it _is_ the same tho, it might be good to add it in the article. 68.174.98.250 (talk) 18:02, 13 March 2010 (UTC)
replies: text: d^2(\vec X,\vec Y) = \sum_{i=1}^n \left(\frac{X_i - Y_i}{\sigma_i}\right)^2
This would have a \chi^2 distribution with n degrees of freedom if the thing in brackets would be normally distributed. But it is not! Both X_i and Y_i have variance \sigma_i^2, so their difference has variance 2\sigma_i^2 which means the term in brackets has variance 2 and not 1. I think the correct statement is that D_M^2(\vec X) is \chi^2-distributed with n degrees of freedom since there we are subtracting the true mean and not another random vector. Based on the above reasoning I also think that d^2(\vec X, \vec Y)/2 is \chi^2-distributed with n degrees of freedom. Unfortunately I don't have a reference for any of this. Any objections to changing the article accordingly? MWiebusch78 10:41, 12 June 2019 (UTC)
thread_title:  Distribution 

message: The current link to the original reference, Mahalanobis (1936), is not working
I got the paper (for free) from http://www.insa.ac.in/insa_pdf/20005b8c_49.pdf but this did require registration (and I am not sure the link will work without or how to test that - it does at least work for me in a different browser than the one I used to register).  —Preceding unsigned comment added by 124.184.162.72 (talk) 23:30, 3 February 2011 (UTC)
replies: text: Thanks. That links works for me too and I haven't registered, so I'll add it to the article. Qwfp (talk) 09:59, 4 February 2011 (UTC)
thread_title:  Original reference 

message: How do you calculate Mahalanobis distance when the covariance matrix has determinant=0 (can´t be inverted)? (talk) 0:31, 27 February 2012 (UTC)
replies: text: I'd imagine there are two answers: 1) It's undefined. 2) It's infinite if the point in question is any distance in the direction of the singular value; otherwise use the pseudoinverse and you have something that's well-defined. —Ben FrantzDale (talk) 02:29, 28 February 2012 (UTC)
thread_title:  Non-invertible covariance matrix 

message: I'm not sure I agree with the characterization of Euclidean distance.  Mahalanobis distance is clearly just an inner product defined by the nonnegative definite matrix S^-1.  Anyone know why a concept that had been around in mathematics since about the time of Cauchy or before got named for a statistician in the 1930s?
briardew (talk) 17:29, 16 August 2012 (UTC)
thread_title:  Inner product 

message: Maybe a numerical example should be added to the article?
Carstensen (talk) 17:48, 10 November 2012 (UTC)
thread_title:  Numerical example 

message: This name "Mahalanobis distance" is completely non-standard.  It is a simple concept, showing up frequently in analyses of a dependent variable with correlated errors, and has been around for long before this person.  Why should a very old concept be named after somebody from the 20th century?   The article is of poor quality and makes statements referring to this as "Mahalanobis' discovery," when this is patently false.
: I have a similar gripe, expressed two comments above.  I think the answer to both of our comments requires a little more research than I'm willing to do.  Indeed, the term "Mahalanobis distance" is used in the statistical literature, so there ought to be some context in which M. added something which is new.  I'd love for one of the maintainers of this article to add some clarity to the point.  Or we could just delete the article altogether.  Kidding ... well, not really. briardew (talk) 20:48, 10 May 2013 (UTC)
replies: text: Actually, I think I've solved this puzzle.  The Mahalanobis distance is a metric defined on collections/ensembles of samples.  This article describes plain Euclidean distance, which clearly Mahalanobis didn't discover because Euclid is like 2000 years older than him.  This is clarified in a great review by McLachlan (http://www.ias.ac.in/resonance/June1999/pdf/June1999p20-26).  Unless someone responds to this in the near future (couple months), I'm going to almost completely rewrite this article, so it's actually accurate. briardew (talk) 21:09, 10 May 2013 (UTC)
thread_title:  Non-standard name 

message: This contains the following: "we will get an equation for a metric that looks a lot like the Mahalanobis distance". What does this mean? "Looks a lot like" is vague and completely unhelpful - either it is the same expression or it isn't. If it isn't the difference should be explicated. Perhaps an expert could rewrite this section clearly - otherwise I think it would be better deleted, but I thought I'd comment here before doing that.
Also perhaps the section should have a more specific heading than "Discussion" - it's far from being a general discussion.  — Preceding unsigned comment added by 213.162.107.11 (talk) 11:57, 2 June 2014 (UTC)
thread_title:  "Discussion" section 

message: It is extremely necessary. Currently I am unable to understand it BurstPower (talk) 13:08, 18 November 2015 (UTC)
thread_title:  Pseudocode or real data example 

message: This section concludes with a opaque statement that "if the data has a nontrivial nullspace, Mahalanobis distance can be computed after projecting the data (non-degenerately) down onto any space of the appropriate dimension for the data." It would really help if somone who understands this statement can rephrase it more precisely while linking to pages that define any necessary jargon. An equation would be ideal. Carroll.ian (talk) 04:10, 20 April 2017 (UTC)
thread_title:  Definition and Properties 

message: Often you want to know, what is the probability for a sample to have a Mahalanobis distance greater than R? I think this should be discussed in the article, including how it maps to sigma values of a univariate distribution, and with reference to confidence regions. Cesiumfrog (talk) 01:35, 10 November 2017 (UTC)
thread_title:  Contours of credibility 

message: A search at commons found the following diagrams:
MahalanobisDist0.png
MahalanobisDist1.png
MahalanobisDist2.png
However, since their descriptions (click on images to see them) are in Polish only, some expert is needed to select the most appropriate one and devise a good caption. - Jochen Burghardt (talk) 19:05, 28 March 2019 (UTC)
thread_title:  Diagrams available