annotate toolboxes/FullBNT-1.0.7/netlab3.3/mdnpost.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function [post, a] = mdnpost(mixparams, t)
wolffd@0 2 %MDNPOST Computes the posterior probability for each MDN mixture component.
wolffd@0 3 %
wolffd@0 4 % Description
wolffd@0 5 % POST = MDNPOST(MIXPARAMS, T) computes the posterior probability
wolffd@0 6 % P(J|T) of each data vector in T under the Gaussian mixture model
wolffd@0 7 % represented by the corresponding entries in MIXPARAMS. Each row of T
wolffd@0 8 % represents a single vector.
wolffd@0 9 %
wolffd@0 10 % [POST, A] = MDNPOST(MIXPARAMS, T) also computes the activations A
wolffd@0 11 % (i.e. the probability P(T|J) of the data conditioned on each
wolffd@0 12 % component density) for a Gaussian mixture model.
wolffd@0 13 %
wolffd@0 14 % See also
wolffd@0 15 % MDNGRAD, MDNPROB
wolffd@0 16 %
wolffd@0 17
wolffd@0 18 % Copyright (c) Ian T Nabney (1996-2001)
wolffd@0 19 % David J Evans (1998)
wolffd@0 20
wolffd@0 21 [prob a] = mdnprob(mixparams, t);
wolffd@0 22
wolffd@0 23 s = sum(prob, 2);
wolffd@0 24 % Set any zeros to one before dividing
wolffd@0 25 s = s + (s==0);
wolffd@0 26 post = prob./(s*ones(1, mixparams.ncentres));