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