Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/KPMtools/conf2mahal.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 % CONF2MAHAL - Translates a confidence interval to a Mahalanobis | |
2 % distance. 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. Similarly, | |
16 % a particular confidence interval uniquely determines | |
17 % an ellipsoid with a fixed Mahalanobis distance. | |
18 % | |
19 % If X is an d dimensional Gaussian-distributed vector, | |
20 % then the Mahalanobis distance of X is distributed | |
21 % according to the Chi-squared distribution with d | |
22 % degrees of freedom. Thus, the Mahalanobis distance is | |
23 % determined by evaluating the inverse cumulative | |
24 % distribution function of the chi squared distribution | |
25 % up to the confidence value. | |
26 % | |
27 % Usage: | |
28 % | |
29 % m = conf2mahal(c, d); | |
30 % | |
31 % Inputs: | |
32 % | |
33 % c - the confidence interval | |
34 % d - the number of dimensions of the Gaussian distribution | |
35 % | |
36 % Outputs: | |
37 % | |
38 % m - the Mahalanobis radius of the ellipsoid enclosing the | |
39 % fraction c of the distribution's probability mass | |
40 % | |
41 % See also: MAHAL2CONF | |
42 | |
43 % Copyright (C) 2002 Mark A. Paskin | |
44 % | |
45 % This program is free software; you can redistribute it and/or modify | |
46 % it under the terms of the GNU General Public License as published by | |
47 % the Free Software Foundation; either version 2 of the License, or | |
48 % (at your option) any later version. | |
49 % | |
50 % This program is distributed in the hope that it will be useful, but | |
51 % WITHOUT ANY WARRANTY; without even the implied warranty of | |
52 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
53 % General Public License for more details. | |
54 % | |
55 % You should have received a copy of the GNU General Public License | |
56 % along with this program; if not, write to the Free Software | |
57 % Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | |
58 % USA. | |
59 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
60 function m = conf2mahal(c, d) | |
61 | |
62 m = chi2inv(c, d); |