comparison toolboxes/FullBNT-1.0.7/bnt/examples/static/Models/mk_vstruct_bnet.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 oracle = mk_vstruct_bnet()
2 % MK_VSTRUCT_BNET Make a simple V-structured 3-node noisy-AND Bayes net
3 % oracle = mk_vstruct_bnet()
4
5 N = 3;
6 dag = zeros(N);
7 A = 1; B = 2; C = 3;
8 dag(A,C)=1;
9 dag(B,C)=1;
10 ns = 2*ones(1,N);
11
12 oracle = mk_bnet(dag, ns);
13 oracle.CPD{1} = tabular_CPD(oracle, 1, [0.5 0.5]);
14 oracle.CPD{2} = tabular_CPD(oracle, 2, [0.5 0.5]);
15 pnoise = 0.1; % degree of noise
16 oracle.CPD{3} = boolean_CPD(oracle, 3, 'named', 'all', pnoise);