Mercurial > hg > camir-aes2014
annotate toolboxes/FullBNT-1.0.7/KPMstats/condgauss_sample.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 x = mixgauss_sample(mu, Sigma, labels) |
wolffd@0 | 2 % MIXGAUSS_SAMPLE Sample from a mixture of Gaussians given known mixture labels |
wolffd@0 | 3 % function x = mixgauss_sample(mu, Sigma, labels) |
wolffd@0 | 4 |
wolffd@0 | 5 T = length(labels); |
wolffd@0 | 6 [D Q] = size(mu); |
wolffd@0 | 7 x = zeros(D,T); |
wolffd@0 | 8 for q=1:Q |
wolffd@0 | 9 ndx = find(labels==q); |
wolffd@0 | 10 x(:,ndx) = gaussian_sample(mu(:,q)', Sigma(:,:,q), length(ndx))'; |
wolffd@0 | 11 end |