comparison toolboxes/FullBNT-1.0.7/HMM/dhmm_sample_endstate.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cc4b1211e677
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