diff options
| author | ziejd2 | 2017-09-28 15:04:40 -0500 |
|---|---|---|
| committer | ziejd2 | 2017-09-28 15:04:40 -0500 |
| commit | 8070dc963753142bb86c4ed698d91fd623ed28e7 (patch) | |
| tree | d0f6dd8fc46a49b819aa55c1a90faa14d8448883 /sourcecodes/bnt-master/KPMtools/mahal2conf.m | |
| parent | 7cc31810d53176e805532b2789955f4eedbce6bb (diff) | |
| download | BNW-8070dc963753142bb86c4ed698d91fd623ed28e7.tar.gz | |
BNW using Octave instead of Matlab.
This version of BNW should perform the same as the original version. The only difference is that it uses Octave instead of Matlab when running BayesNet Toolbox during parameter learning. I am calling this BNW_1.02. It can be accessed at: compbio.uthsc.edu/BNW_1.02
Diffstat (limited to 'sourcecodes/bnt-master/KPMtools/mahal2conf.m')
| -rw-r--r-- | sourcecodes/bnt-master/KPMtools/mahal2conf.m | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/KPMtools/mahal2conf.m b/sourcecodes/bnt-master/KPMtools/mahal2conf.m new file mode 100644 index 00000000..e5535748 --- /dev/null +++ b/sourcecodes/bnt-master/KPMtools/mahal2conf.m @@ -0,0 +1,60 @@ +% MAHAL2CONF - Translates a Mahalanobis distance into a confidence +% interval. Consider a multivariate Gaussian +% distribution of the form +% +% p(x) = 1/sqrt((2 * pi)^d * det(C)) * exp((-1/2) * MD(x, m, inv(C))) +% +% where MD(x, m, P) is the Mahalanobis distance from x +% to m under P: +% +% MD(x, m, P) = (x - m) * P * (x - m)' +% +% A particular Mahalanobis distance k identifies an +% ellipsoid centered at the mean of the distribution. +% The confidence interval associated with this ellipsoid +% is the probability mass enclosed by it. +% +% If X is an d dimensional Gaussian-distributed vector, +% then the Mahalanobis distance of X is distributed +% according to the Chi-squared distribution with d +% degrees of freedom. Thus, the confidence interval is +% determined by integrating the chi squared distribution +% up to the Mahalanobis distance of the measurement. +% +% Usage: +% +% c = mahal2conf(m, d); +% +% Inputs: +% +% m - the Mahalanobis radius of the ellipsoid +% d - the number of dimensions of the Gaussian distribution +% +% Outputs: +% +% c - the confidence interval, i.e., the fraction of +% probability mass enclosed by the ellipsoid with the +% supplied Mahalanobis distance +% +% See also: CONF2MAHAL + +% Copyright (C) 2002 Mark A. Paskin +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +% USA. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function c = mahal2conf(m, d) + +c = chi2cdf(m, d); \ No newline at end of file |
