comparison toolboxes/FullBNT-1.0.7/KPMtools/mahal2conf.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 % MAHAL2CONF - Translates a Mahalanobis distance into a confidence
2 % interval. Consider a multivariate Gaussian
3 % distribution of the form
4 %
5 % p(x) = 1/sqrt((2 * pi)^d * det(C)) * exp((-1/2) * MD(x, m, inv(C)))
6 %
7 % where MD(x, m, P) is the Mahalanobis distance from x
8 % to m under P:
9 %
10 % MD(x, m, P) = (x - m) * P * (x - m)'
11 %
12 % A particular Mahalanobis distance k identifies an
13 % ellipsoid centered at the mean of the distribution.
14 % The confidence interval associated with this ellipsoid
15 % is the probability mass enclosed by it.
16 %
17 % If X is an d dimensional Gaussian-distributed vector,
18 % then the Mahalanobis distance of X is distributed
19 % according to the Chi-squared distribution with d
20 % degrees of freedom. Thus, the confidence interval is
21 % determined by integrating the chi squared distribution
22 % up to the Mahalanobis distance of the measurement.
23 %
24 % Usage:
25 %
26 % c = mahal2conf(m, d);
27 %
28 % Inputs:
29 %
30 % m - the Mahalanobis radius of the ellipsoid
31 % d - the number of dimensions of the Gaussian distribution
32 %
33 % Outputs:
34 %
35 % c - the confidence interval, i.e., the fraction of
36 % probability mass enclosed by the ellipsoid with the
37 % supplied Mahalanobis distance
38 %
39 % See also: CONF2MAHAL
40
41 % Copyright (C) 2002 Mark A. Paskin
42 %
43 % This program is free software; you can redistribute it and/or modify
44 % it under the terms of the GNU General Public License as published by
45 % the Free Software Foundation; either version 2 of the License, or
46 % (at your option) any later version.
47 %
48 % This program is distributed in the hope that it will be useful, but
49 % WITHOUT ANY WARRANTY; without even the implied warranty of
50 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
51 % General Public License for more details.
52 %
53 % You should have received a copy of the GNU General Public License
54 % along with this program; if not, write to the Free Software
55 % Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
56 % USA.
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58 function c = mahal2conf(m, d)
59
60 c = chi2cdf(m, d);