Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/examples/static/Models/mk_ideker_bnet.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function bnet = mk_ideker_bnet(CPD_type, p) | |
2 % MK_IDEKER_BNET Make the Bayes net in the PSB'00 paper by Ideker, Thorsson and Karp. | |
3 % | |
4 % BNET = MK_IDEKER_BNET uses the boolean functions specified in the paper | |
5 % "Discovery of regulatory interactions through perturbation: inference and experimental design", | |
6 % Pacific Symp. on Biocomputing, 2000. | |
7 % | |
8 % BNET = MK_IDEKER_BNET('root') uses the above boolean functions, but puts a uniform | |
9 % distribution on the root nodes. | |
10 % | |
11 % BNET = MK_IDEKER_BNET('cpt', p) uses random parameters drawn from a Dirichlet(p,p,...) | |
12 % distribution. If p << 1, this is nearly deterministic; if p >> 1, this is nearly uniform. | |
13 % | |
14 % BNET = MK_IDEKER_BNET('bool') makes each CPT a random boolean function. | |
15 % | |
16 % BNET = MK_IDEKER_BNET('orig') is the same as MK_IDEKER_BNET. | |
17 | |
18 | |
19 if nargin == 0 | |
20 CPD_type = 'orig'; | |
21 end | |
22 | |
23 n = 4; | |
24 dag = zeros(n); | |
25 dag(1,3)=1; | |
26 dag(2,[3 4])=1; | |
27 dag(3,4)=1; | |
28 ns = 2*ones(1,n); | |
29 bnet = mk_bnet(dag, ns); | |
30 | |
31 switch CPD_type | |
32 case 'orig', | |
33 bnet.CPD{1} = tabular_CPD(bnet, 1, [0 1]); | |
34 bnet.CPD{2} = tabular_CPD(bnet, 2, [0 1]); | |
35 bnet.CPD{3} = boolean_CPD(bnet, 3, 'inline', inline('x(1) & x(2)')); | |
36 bnet.CPD{4} = boolean_CPD(bnet, 4, 'inline', inline('x(1) & ~x(2)')); | |
37 case 'root', | |
38 bnet.CPD{1} = tabular_CPD(bnet, 1, [0.5 0.5]); | |
39 bnet.CPD{2} = tabular_CPD(bnet, 2, [0.5 0.5]); | |
40 bnet.CPD{3} = boolean_CPD(bnet, 3, 'inline', inline('x(1) & x(2)')); | |
41 bnet.CPD{4} = boolean_CPD(bnet, 4, 'inline', inline('x(1) & ~x(2)')); | |
42 case 'bool', | |
43 for i=1:n | |
44 bnet.CPD{i} = boolean_CPD(bnet, i, 'rnd'); | |
45 end | |
46 case 'cpt', | |
47 for i=1:n | |
48 bnet.CPD{i} = tabular_CPD(bnet, i, p); | |
49 end | |
50 otherwise, | |
51 error(['unknown type ' CPD_type]); | |
52 end |