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