wolffd@0: % CONF2MAHAL - Translates a confidence interval to a Mahalanobis wolffd@0: % distance. Consider a multivariate Gaussian wolffd@0: % distribution of the form wolffd@0: % wolffd@0: % p(x) = 1/sqrt((2 * pi)^d * det(C)) * exp((-1/2) * MD(x, m, inv(C))) wolffd@0: % wolffd@0: % where MD(x, m, P) is the Mahalanobis distance from x wolffd@0: % to m under P: wolffd@0: % wolffd@0: % MD(x, m, P) = (x - m) * P * (x - m)' wolffd@0: % wolffd@0: % A particular Mahalanobis distance k identifies an wolffd@0: % ellipsoid centered at the mean of the distribution. wolffd@0: % The confidence interval associated with this ellipsoid wolffd@0: % is the probability mass enclosed by it. Similarly, wolffd@0: % a particular confidence interval uniquely determines wolffd@0: % an ellipsoid with a fixed Mahalanobis distance. wolffd@0: % wolffd@0: % If X is an d dimensional Gaussian-distributed vector, wolffd@0: % then the Mahalanobis distance of X is distributed wolffd@0: % according to the Chi-squared distribution with d wolffd@0: % degrees of freedom. Thus, the Mahalanobis distance is wolffd@0: % determined by evaluating the inverse cumulative wolffd@0: % distribution function of the chi squared distribution wolffd@0: % up to the confidence value. wolffd@0: % wolffd@0: % Usage: wolffd@0: % wolffd@0: % m = conf2mahal(c, d); wolffd@0: % wolffd@0: % Inputs: wolffd@0: % wolffd@0: % c - the confidence interval wolffd@0: % d - the number of dimensions of the Gaussian distribution wolffd@0: % wolffd@0: % Outputs: wolffd@0: % wolffd@0: % m - the Mahalanobis radius of the ellipsoid enclosing the wolffd@0: % fraction c of the distribution's probability mass wolffd@0: % wolffd@0: % See also: MAHAL2CONF wolffd@0: wolffd@0: % Copyright (C) 2002 Mark A. Paskin wolffd@0: % wolffd@0: % This program is free software; you can redistribute it and/or modify wolffd@0: % it under the terms of the GNU General Public License as published by wolffd@0: % the Free Software Foundation; either version 2 of the License, or wolffd@0: % (at your option) any later version. wolffd@0: % wolffd@0: % This program is distributed in the hope that it will be useful, but wolffd@0: % WITHOUT ANY WARRANTY; without even the implied warranty of wolffd@0: % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU wolffd@0: % General Public License for more details. wolffd@0: % wolffd@0: % You should have received a copy of the GNU General Public License wolffd@0: % along with this program; if not, write to the Free Software wolffd@0: % Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 wolffd@0: % USA. wolffd@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wolffd@0: function m = conf2mahal(c, d) wolffd@0: wolffd@0: m = chi2inv(c, d);