about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/HMM/dhmm_sample.m
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/bnt-master/HMM/dhmm_sample.m')
-rw-r--r--sourcecodes/bnt-master/HMM/dhmm_sample.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/HMM/dhmm_sample.m b/sourcecodes/bnt-master/HMM/dhmm_sample.m
new file mode 100644
index 00000000..5122c81b
--- /dev/null
+++ b/sourcecodes/bnt-master/HMM/dhmm_sample.m
@@ -0,0 +1,10 @@
+function [obs, hidden] = dhmm_sample(initial_prob, transmat, obsmat, numex, len)
+% SAMPLE_DHMM Generate random sequences from a Hidden Markov Model with discrete outputs.
+%
+% [obs, hidden] = sample_dhmm(initial_prob, transmat, obsmat, numex, len)
+% Each row of obs is an observation sequence of length len.
+
+hidden = mc_sample(initial_prob, transmat, len, numex);
+obs = multinomial_sample(hidden, obsmat);
+
+