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