Home > gmmbayestb-v1.0 > gmmb_frac2lhood.m

gmmb_frac2lhood

PURPOSE ^

GMMB_FRAC2LHOOD Map density quantiles to PDF threshold values

SYNOPSIS ^

function lhood = gmmb_frac2lhood(histS, f);

DESCRIPTION ^

GMMB_FRAC2LHOOD   Map density quantiles to PDF threshold values

    lhood = GMMB_FRAC2LHOOD(histS, f)

    histS   K-element histS cell array created by gmmb_hist or
            gmmb_generatehist.
    lhood   N x K array of likelihood values.
    f       N x K array of density quantile values

    This function finds the likelihood threshold value corresponding to
    each density quantile value.
    For each column k in 1..K, the likelihood value is found from histS{k},
    so that each column may represent a different distribution.

    See gmmb_hist, gmmb_generatehist, gmmb_lhood2frac, gmmb_fracthresh

 References:
   [1] Paalanen, P., Kamarainen, J.-K., Ilonen, J., Kälviäinen, H.,
    Feature Representation and Discrimination Based on Gaussian Mixture Model
    Probability Densities - Practices and Algorithms, Research Report 95,
    Lappeenranta University of Technology, Department of Information
    Technology, 2005.

 Author(s):
    Pekka Paalanen <pekka.paalanen@lut.fi>
    Jarmo Ilonen <jarmo.ilonen@lut.fi>
    Joni Kamarainen <Joni.Kamarainen@lut.fi>

 Copyright:

   Bayesian Classifier with Gaussian Mixture Model Pdf
   functionality is Copyright (C) 2004 by Pekka Paalanen and
   Joni-Kristian Kamarainen.

   $Name:  $ $Revision: 1.2 $  $Date: 2005/04/14 10:33:34 $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %GMMB_FRAC2LHOOD   Map density quantiles to PDF threshold values
0002 %
0003 %    lhood = GMMB_FRAC2LHOOD(histS, f)
0004 %
0005 %    histS   K-element histS cell array created by gmmb_hist or
0006 %            gmmb_generatehist.
0007 %    lhood   N x K array of likelihood values.
0008 %    f       N x K array of density quantile values
0009 %
0010 %    This function finds the likelihood threshold value corresponding to
0011 %    each density quantile value.
0012 %    For each column k in 1..K, the likelihood value is found from histS{k},
0013 %    so that each column may represent a different distribution.
0014 %
0015 %    See gmmb_hist, gmmb_generatehist, gmmb_lhood2frac, gmmb_fracthresh
0016 %
0017 % References:
0018 %   [1] Paalanen, P., Kamarainen, J.-K., Ilonen, J., Kälviäinen, H.,
0019 %    Feature Representation and Discrimination Based on Gaussian Mixture Model
0020 %    Probability Densities - Practices and Algorithms, Research Report 95,
0021 %    Lappeenranta University of Technology, Department of Information
0022 %    Technology, 2005.
0023 %
0024 % Author(s):
0025 %    Pekka Paalanen <pekka.paalanen@lut.fi>
0026 %    Jarmo Ilonen <jarmo.ilonen@lut.fi>
0027 %    Joni Kamarainen <Joni.Kamarainen@lut.fi>
0028 %
0029 % Copyright:
0030 %
0031 %   Bayesian Classifier with Gaussian Mixture Model Pdf
0032 %   functionality is Copyright (C) 2004 by Pekka Paalanen and
0033 %   Joni-Kristian Kamarainen.
0034 %
0035 %   $Name:  $ $Revision: 1.2 $  $Date: 2005/04/14 10:33:34 $
0036 %
0037 
0038 function lhood = gmmb_frac2lhood(histS, f);
0039 
0040 if any(f(:)>1 | f(:)<0)
0041     error('Density quantile values must be in the range [0,1].');
0042 end
0043 
0044 lhood = zeros(size(f));
0045 
0046 K = size(f, 2);
0047 
0048 for k = 1:K
0049     v = shiftdim(histS{k});
0050     len_v = length(v);
0051     nf = (1-f(:,k)) .* (len_v-1) +1;
0052     i = floor(nf);
0053 
0054     v(len_v+1) = v(len_v);
0055     lhood(:, k) = v(i) + ( nf-i ) .* ( v(i+1) - v(i) );
0056 end

Generated on Thu 14-Apr-2005 13:50:22 by m2html © 2003