about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/examples/dynamic/mk_mildew_dbn.m
diff options
context:
space:
mode:
authorziejd22018-03-14 23:23:33 -0500
committerGitHub2018-03-14 23:23:33 -0500
commit1ff6baa44e22b91eefb48aea6f3befa078c0489b (patch)
treee0fd79d2e32fd2aedda2eadaed0f19af3514c520 /sourcecodes/bnt-master/BNT/examples/dynamic/mk_mildew_dbn.m
parent6882395afdadf4e982b25b5215071a0932730950 (diff)
parentc80226899f5cdd9f11c163817d59445213f5bef0 (diff)
downloadBNW-1ff6baa44e22b91eefb48aea6f3befa078c0489b.tar.gz
Merge pull request #1 from ziejd2/octave_php_separate
Octave php separate
Diffstat (limited to 'sourcecodes/bnt-master/BNT/examples/dynamic/mk_mildew_dbn.m')
-rw-r--r--sourcecodes/bnt-master/BNT/examples/dynamic/mk_mildew_dbn.m31
1 files changed, 31 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/BNT/examples/dynamic/mk_mildew_dbn.m b/sourcecodes/bnt-master/BNT/examples/dynamic/mk_mildew_dbn.m
new file mode 100644
index 00000000..71f393e3
--- /dev/null
+++ b/sourcecodes/bnt-master/BNT/examples/dynamic/mk_mildew_dbn.m
@@ -0,0 +1,31 @@
+function bnet = mk_mildew_dbn()
+
+% DBN for foreacasting the gross yield of wheat based on climatic data,
+% observations of leaf area index (LAI) and extension of mildew,
+% and knowledge of amount of fungicides used and time of usage.
+% From Kjaerulff '95.
+
+Fungi=1; Mildew=2; LAI=3; Precip=4; Temp=5; Micro=6; Solar=7; Photo=8; Dry=9;
+n = 9;
+intra = zeros(n,n);
+intra(Mildew, LAI)=1;
+intra(LAI,[Micro Photo])=1;
+intra(Precip,Micro)=1;
+intra(Temp,[Micro Photo])=1;
+intra(Solar,Photo)=1;
+intra(Photo,Dry)=1;
+
+inter = zeros(n,n);
+inter(Fungi,Mildew)=1;
+inter(Mildew,Mildew)=1;
+inter(LAI,LAI)=1;
+inter(Micro,Mildew)=1;
+inter(Dry,Dry)=1;
+
+ns = 2*ones(1,n);
+bnet = mk_dbn(intra, inter, ns, 'observed', [Photo]);
+
+for e=1:max(bnet.equiv_class(:))
+  i = bnet.rep_of_eclass(e);
+  bnet.CPD{e} = tabular_CPD(bnet,i);
+end