GMMB_GENERATEHIST Create histS structure for PDF-value - density quantile mapping. histS = GMMB_GENERATEHIST(bayesS, N) bayesS parameters for the distributions to be used N number of approximation points per class This function creates ordered lists of PDF-values of random points generated by given distributions (bayesS). These lists can be used to evaluate distribution density quantiles. See gmmb_hist, gmmb_lhood2frac, gmmb_frac2lhood, 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 $
0001 %GMMB_GENERATEHIST Create histS structure for PDF-value - density quantile mapping. 0002 % 0003 % histS = GMMB_GENERATEHIST(bayesS, N) 0004 % 0005 % bayesS parameters for the distributions to be used 0006 % N number of approximation points per class 0007 % 0008 % This function creates ordered lists of PDF-values of 0009 % random points generated by given distributions (bayesS). 0010 % These lists can be used to evaluate distribution density quantiles. 0011 % 0012 % See gmmb_hist, gmmb_lhood2frac, gmmb_frac2lhood, gmmb_fracthresh 0013 % 0014 % References: 0015 % [1] Paalanen, P., Kamarainen, J.-K., Ilonen, J., Kälviäinen, H., 0016 % Feature Representation and Discrimination Based on Gaussian Mixture Model 0017 % Probability Densities - Practices and Algorithms, Research Report 95, 0018 % Lappeenranta University of Technology, Department of Information 0019 % Technology, 2005. 0020 % 0021 % Author(s): 0022 % Pekka Paalanen <pekka.paalanen@lut.fi> 0023 % Jarmo Ilonen <jarmo.ilonen@lut.fi> 0024 % Joni Kamarainen <Joni.Kamarainen@lut.fi> 0025 % 0026 % Copyright: 0027 % 0028 % Bayesian Classifier with Gaussian Mixture Model Pdf 0029 % functionality is Copyright (C) 2004 by Pekka Paalanen and 0030 % Joni-Kristian Kamarainen. 0031 % 0032 % $Name: $ $Revision: 1.2 $ $Date: 2005/04/14 10:33:34 $ 0033 % 0034 0035 function histS = gmmb_generatehist(bayesS, N); 0036 0037 K = size(bayesS,2); 0038 0039 histS = {}; 0040 0041 for k = 1:K 0042 samples = []; 0043 Mu = bayesS(k).mu; 0044 0045 for c = 1:size(Mu, 2) 0046 n = ceil(N*bayesS(k).weight(c)); 0047 if ~isreal(Mu) 0048 samples = [ samples; ... 0049 gmmb_mkcplx(Mu(:,c).', bayesS(k).sigma(:,:,c), n) ]; 0050 else 0051 samples = [ samples; ... 0052 mvnrnd(Mu(:,c).', bayesS(k).sigma(:,:,c), n) ]; 0053 end 0054 end 0055 0056 dens = gmmb_pdf( samples, bayesS(k) ); 0057 histS(k) = {sort(dens)}; 0058 end