annotate toolboxes/FullBNT-1.0.7/KPMtools/conf2mahal.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 % CONF2MAHAL - Translates a confidence interval to a Mahalanobis
Daniel@0 2 % distance. Consider a multivariate Gaussian
Daniel@0 3 % distribution of the form
Daniel@0 4 %
Daniel@0 5 % p(x) = 1/sqrt((2 * pi)^d * det(C)) * exp((-1/2) * MD(x, m, inv(C)))
Daniel@0 6 %
Daniel@0 7 % where MD(x, m, P) is the Mahalanobis distance from x
Daniel@0 8 % to m under P:
Daniel@0 9 %
Daniel@0 10 % MD(x, m, P) = (x - m) * P * (x - m)'
Daniel@0 11 %
Daniel@0 12 % A particular Mahalanobis distance k identifies an
Daniel@0 13 % ellipsoid centered at the mean of the distribution.
Daniel@0 14 % The confidence interval associated with this ellipsoid
Daniel@0 15 % is the probability mass enclosed by it. Similarly,
Daniel@0 16 % a particular confidence interval uniquely determines
Daniel@0 17 % an ellipsoid with a fixed Mahalanobis distance.
Daniel@0 18 %
Daniel@0 19 % If X is an d dimensional Gaussian-distributed vector,
Daniel@0 20 % then the Mahalanobis distance of X is distributed
Daniel@0 21 % according to the Chi-squared distribution with d
Daniel@0 22 % degrees of freedom. Thus, the Mahalanobis distance is
Daniel@0 23 % determined by evaluating the inverse cumulative
Daniel@0 24 % distribution function of the chi squared distribution
Daniel@0 25 % up to the confidence value.
Daniel@0 26 %
Daniel@0 27 % Usage:
Daniel@0 28 %
Daniel@0 29 % m = conf2mahal(c, d);
Daniel@0 30 %
Daniel@0 31 % Inputs:
Daniel@0 32 %
Daniel@0 33 % c - the confidence interval
Daniel@0 34 % d - the number of dimensions of the Gaussian distribution
Daniel@0 35 %
Daniel@0 36 % Outputs:
Daniel@0 37 %
Daniel@0 38 % m - the Mahalanobis radius of the ellipsoid enclosing the
Daniel@0 39 % fraction c of the distribution's probability mass
Daniel@0 40 %
Daniel@0 41 % See also: MAHAL2CONF
Daniel@0 42
Daniel@0 43 % Copyright (C) 2002 Mark A. Paskin
Daniel@0 44 %
Daniel@0 45 % This program is free software; you can redistribute it and/or modify
Daniel@0 46 % it under the terms of the GNU General Public License as published by
Daniel@0 47 % the Free Software Foundation; either version 2 of the License, or
Daniel@0 48 % (at your option) any later version.
Daniel@0 49 %
Daniel@0 50 % This program is distributed in the hope that it will be useful, but
Daniel@0 51 % WITHOUT ANY WARRANTY; without even the implied warranty of
Daniel@0 52 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Daniel@0 53 % General Public License for more details.
Daniel@0 54 %
Daniel@0 55 % You should have received a copy of the GNU General Public License
Daniel@0 56 % along with this program; if not, write to the Free Software
Daniel@0 57 % Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
Daniel@0 58 % USA.
Daniel@0 59 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Daniel@0 60 function m = conf2mahal(c, d)
Daniel@0 61
Daniel@0 62 m = chi2inv(c, d);