Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/examples/dynamic/arhmm1.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 % Make an HMM with autoregressive Gaussian observations (switching AR model) | |
2 % X1 -> X2 | |
3 % | | | |
4 % v v | |
5 % Y1 -> Y2 | |
6 | |
7 seed = 0; | |
8 rand('state', seed); | |
9 randn('state', seed); | |
10 | |
11 intra = zeros(2); | |
12 intra(1,2) = 1; | |
13 inter = zeros(2); | |
14 inter(1,1) = 1; | |
15 inter(2,2) = 1; | |
16 n = 2; | |
17 | |
18 Q = 2; % num hidden states | |
19 O = 2; % size of observed vector | |
20 | |
21 ns = [Q O]; | |
22 dnodes = 1; | |
23 onodes = [2]; | |
24 bnet = mk_dbn(intra, inter, ns, 'discrete', dnodes, 'observed', onodes); | |
25 | |
26 bnet.CPD{1} = tabular_CPD(bnet, 1); | |
27 bnet.CPD{2} = gaussian_CPD(bnet, 2); | |
28 bnet.CPD{3} = tabular_CPD(bnet, 3); | |
29 bnet.CPD{4} = gaussian_CPD(bnet, 4); | |
30 | |
31 | |
32 T = 10; % fixed length sequences | |
33 | |
34 engine = {}; | |
35 %engine{end+1} = hmm_inf_engine(bnet); | |
36 engine{end+1} = jtree_unrolled_dbn_inf_engine(bnet, T); | |
37 %engine{end+1} = smoother_engine(hmm_2TBN_inf_engine(bnet)); | |
38 %engine{end+1} = smoother_engine(jtree_2TBN_inf_engine(bnet)); | |
39 | |
40 inf_time = cmp_inference_dbn(bnet, engine, T, 'check_ll',1); | |
41 learning_time = cmp_learning_dbn(bnet, engine, T, 'check_ll', 1); | |
42 |