annotate toolboxes/FullBNT-1.0.7/bnt/examples/static/StructLearn/pc1.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 % SGS p118
wolffd@0 2 % Try learning the structure using an oracle for the cond indep tests
wolffd@0 3
wolffd@0 4 n = 5;
wolffd@0 5
wolffd@0 6 A = 1; B = 2; C = 3; D = 4; E = 5;
wolffd@0 7
wolffd@0 8 G = zeros(n);
wolffd@0 9 G(A,B)=1;
wolffd@0 10 G(B,[C D]) = 1;
wolffd@0 11 G(C,E)=1;
wolffd@0 12 G(D,E)=1;
wolffd@0 13
wolffd@0 14 k = 2;
wolffd@0 15
wolffd@0 16 pdag = learn_struct_pdag_pc('dsep', n, k, G)
wolffd@0 17
wolffd@0 18
wolffd@0 19
wolffd@0 20
wolffd@0 21 if 0
wolffd@0 22 N = 4;
wolffd@0 23 dag = zeros(N,N);
wolffd@0 24 C = 1; S = 2; R = 3; W = 4;
wolffd@0 25 dag(C,[R S]) = 1;
wolffd@0 26 dag(R,W) = 1;
wolffd@0 27 dag(S,W)=1;
wolffd@0 28
wolffd@0 29 pdag = learn_struct_pdag_pc('dsep', N, 2, dag)
wolffd@0 30 end