Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/docs/param_tieing.html @ 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 | |
2 <h2>Example of more complex parameter tieing</h2> | |
3 | |
4 We now give a more complex pattern of parameter tieing. | |
5 (This example is due to Rainer Deventer.) | |
6 The structure is as follows: | |
7 <p> | |
8 <img src="Figures/rainer_tied.gif" height="400"> | |
9 <!--<img src="rainer_dbn.jpg" height="600">--> | |
10 <p> | |
11 Since nodes 2 and 3 in slice 2 (N7 and N8) | |
12 have different parents than their counterparts in slice 1 (N2 and N3), | |
13 they must be put into different equivalence classes. | |
14 Hence we define | |
15 <pre> | |
16 eclass1 = [1 2 3 4 5]; | |
17 eclass2 = [1 6 7 4 5]; | |
18 </pre> | |
19 The dotted bubbles represent the equivalence classes. | |
20 Node 7 is the representative node for equivalence class | |
21 6, and node 8 is the rep. for class 7, so we need to write | |
22 <pre> | |
23 bnet.CPD{6} = xxx_CPD(bnet, 7, xxx); | |
24 bnet.CPD{7} = xxx_CPD(bnet, 8, xxx); | |
25 </pre> | |
26 In general, you can use the following code fragment: | |
27 <pre> | |
28 eclass = bnet.equiv_class(:); | |
29 for e=1:max(eclass) | |
30 i = bnet.rep_of_eclass(e); | |
31 bnet.CPD{e} = xxx_CPD(bnet,i); | |
32 end | |
33 </pre> | |
34 <!-- | |
35 which is equivalent to | |
36 <pre> | |
37 E = max(eclass); | |
38 rep = zeros(1,E); | |
39 for e=1:E | |
40 mems = find(eclass==e); | |
41 rep(e) = mems(1); | |
42 end | |
43 for e=1:E | |
44 bnet.CPD{e} = xxx_CPD(bnet, rep(e)); | |
45 end | |
46 </pre> | |
47 --> |