Calculate distance from point p to high dimensional Gaussian (M, V)?

If V is a valid covariance matrix of a gaussian, it then is symmetric positive definite and therefore defines a valid scalar product. By the way inv(V) also does.

If V is a valid covariance matrix of a gaussian, it then is symmetric positive definite and therefore defines a valid scalar product. By the way inv(V) also does. Therefore, assuming that M and p are column vectors, you could define distances as: d1 = sqrt((M-p)'*V*(M-p)); d2 = sqrt((M-p)'*inv(V)*(M-p)); the Matlab way one would rewrite d2as (probably some unnecessary parentheses): d2 = sqrt((M-p)'*(V\(M-p))); The nice thing is that when V is the unit matrix, then d1==d2and it correspond to the classical euclidian distance.To find wether you have to use d1 or d2is left as an exercise (sorry, part of my job is teaching).

Write the multi-dimensional gaussian formula and compare it to the 1D case, since the multidimensional case is only a particular case of the 1D (or perform some numerical experiment). NB: in very high dimensional spaces or for very many points to test, you might find a clever / faster way from the eigenvectors and eigenvalues of V (i.e. The principal axes of the ellipsoid and their corresponding variance).

Hope this helps. A.

This seems to be it. Thank you! – El-ad Dec 15 '10 at 22:45.

Consider computing the probability of the point given the normal distribution: M = 1 -1; %# mean vector V = .9 .4; .4 .3; %# covariance matrix p = 0.5 -1.5; %# 2d-point prob = mvnpdf(p,M,V); %# probability P(p|mu,cov) The function MVNPDF is provided by the Statistics Toolbox.

PSEUDOCODE: foreach(dimension d) (M(d) - sigma(d) So actually, this is just a space problem and your Gaussian hasn't have to do anything with it (except for M and sigma which are just distances). In MATLAB you could try something like: all(M - sigma Just 2 vectors. And now the final one.

You want to know the distance in a form of sigma's: % create a distance vector and divide it by sigma M - p . / sigma I think that will do the trick.

This solution will not work, since it does not take into consideration the covariance (the ellipse is "slanted", in a way). Thanks though! – El-ad Dec 15 '10 at 21:51.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions