Daniel@0: function bnet = mk_ideker_bnet(CPD_type, p) Daniel@0: % MK_IDEKER_BNET Make the Bayes net in the PSB'00 paper by Ideker, Thorsson and Karp. Daniel@0: % Daniel@0: % BNET = MK_IDEKER_BNET uses the boolean functions specified in the paper Daniel@0: % "Discovery of regulatory interactions through perturbation: inference and experimental design", Daniel@0: % Pacific Symp. on Biocomputing, 2000. Daniel@0: % Daniel@0: % BNET = MK_IDEKER_BNET('root') uses the above boolean functions, but puts a uniform Daniel@0: % distribution on the root nodes. Daniel@0: % Daniel@0: % BNET = MK_IDEKER_BNET('cpt', p) uses random parameters drawn from a Dirichlet(p,p,...) Daniel@0: % distribution. If p << 1, this is nearly deterministic; if p >> 1, this is nearly uniform. Daniel@0: % Daniel@0: % BNET = MK_IDEKER_BNET('bool') makes each CPT a random boolean function. Daniel@0: % Daniel@0: % BNET = MK_IDEKER_BNET('orig') is the same as MK_IDEKER_BNET. Daniel@0: Daniel@0: Daniel@0: if nargin == 0 Daniel@0: CPD_type = 'orig'; Daniel@0: end Daniel@0: Daniel@0: n = 4; Daniel@0: dag = zeros(n); Daniel@0: dag(1,3)=1; Daniel@0: dag(2,[3 4])=1; Daniel@0: dag(3,4)=1; Daniel@0: ns = 2*ones(1,n); Daniel@0: bnet = mk_bnet(dag, ns); Daniel@0: Daniel@0: switch CPD_type Daniel@0: case 'orig', Daniel@0: bnet.CPD{1} = tabular_CPD(bnet, 1, [0 1]); Daniel@0: bnet.CPD{2} = tabular_CPD(bnet, 2, [0 1]); Daniel@0: bnet.CPD{3} = boolean_CPD(bnet, 3, 'inline', inline('x(1) & x(2)')); Daniel@0: bnet.CPD{4} = boolean_CPD(bnet, 4, 'inline', inline('x(1) & ~x(2)')); Daniel@0: case 'root', Daniel@0: bnet.CPD{1} = tabular_CPD(bnet, 1, [0.5 0.5]); Daniel@0: bnet.CPD{2} = tabular_CPD(bnet, 2, [0.5 0.5]); Daniel@0: bnet.CPD{3} = boolean_CPD(bnet, 3, 'inline', inline('x(1) & x(2)')); Daniel@0: bnet.CPD{4} = boolean_CPD(bnet, 4, 'inline', inline('x(1) & ~x(2)')); Daniel@0: case 'bool', Daniel@0: for i=1:n Daniel@0: bnet.CPD{i} = boolean_CPD(bnet, i, 'rnd'); Daniel@0: end Daniel@0: case 'cpt', Daniel@0: for i=1:n Daniel@0: bnet.CPD{i} = tabular_CPD(bnet, i, p); Daniel@0: end Daniel@0: otherwise, Daniel@0: error(['unknown type ' CPD_type]); Daniel@0: end