wolffd@0: % TEST_LAYOUT Script to test some bayesian net layouts wolffd@0: % wolffd@0: wolffd@0: % Change History : wolffd@0: % Date Time Prog Note wolffd@0: % 13-Apr-2000 10:40 PM ATC Created under MATLAB 5.3.1.29215a (R11.1) wolffd@0: wolffd@0: % ATC = Ali Taylan Cemgil, wolffd@0: % SNN - University of Nijmegen, Department of Medical Physics and Biophysics wolffd@0: % e-mail : cemgil@mbfys.kun.nl wolffd@0: wolffd@0: %bnet = mk_asia_bnet; wolffd@0: %draw_graph(bnet.dag); wolffd@0: wolffd@0: % Make the following network (from Jensen (1996) p84 fig 4.17) wolffd@0: % 1 wolffd@0: % / | \ wolffd@0: % 2 3 4 wolffd@0: % | | | wolffd@0: % 5 6 7 wolffd@0: % \/ \/ wolffd@0: % 8 9 wolffd@0: % where all arcs point downwards wolffd@0: wolffd@0: disp('plot directed') wolffd@0: clf; wolffd@0: wolffd@0: N = 9; wolffd@0: dag = zeros(N,N); wolffd@0: dag(1,2)=1; dag(1,3)=1; dag(1,4)=1; wolffd@0: dag(2,5)=1; dag(3,6)=1; dag(4,7)=1; wolffd@0: dag(5,8)=1; dag(6,8)=1; dag(6,9)=1; dag(7,9) = 1; wolffd@0: wolffd@0: draw_graph(dag); wolffd@0: wolffd@0: pause wolffd@0: clf wolffd@0: disp('plot undirected') wolffd@0: udag = [dag+dag']; wolffd@0: draw_graph(udag); wolffd@0: wolffd@0: pause wolffd@0: clf wolffd@0: disp('plot mixed') wolffd@0: mg = [dag]; wolffd@0: mg(2,1) = 1; mg(8,5) = 1; wolffd@0: draw_graph(mg); wolffd@0: wolffd@0: wolffd@0: