Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/HMM/dhmm_sample_endstate.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function [obs, hidden] = dhmm_sample_endstate(startprob, transmat, obsmat, endprob, numex) | |
2 % SAMPLE_DHMM Generate random sequences from an HMM with discrete outputs. | |
3 % function [obs, hidden] = sample_dhmm_endstate(startprob, transmat, obsmat, endprob, numex) | |
4 % | |
5 % We sample until we have have entered the end state | |
6 % obs{m} and hidden{m} are the m'th sequence | |
7 | |
8 hidden = cell(1,numex); | |
9 obs = cell(1,numex); | |
10 | |
11 for m=1:numex | |
12 hidden{m} = mc_sample_endstate(startprob, transmat, endprob); | |
13 T = length(hidden{m}); | |
14 obs{m} = zeros(1,T); | |
15 for t=1:T | |
16 h = hidden{m}(t); | |
17 obs{m}(t) = sample_discrete(obsmat(h,:)); | |
18 end | |
19 end |