comparison toolboxes/FullBNT-1.0.7/bnt/examples/dynamic/mk_mildew_dbn.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_mildew_dbn()
2
3 % DBN for foreacasting the gross yield of wheat based on climatic data,
4 % observations of leaf area index (LAI) and extension of mildew,
5 % and knowledge of amount of fungicides used and time of usage.
6 % From Kjaerulff '95.
7
8 Fungi=1; Mildew=2; LAI=3; Precip=4; Temp=5; Micro=6; Solar=7; Photo=8; Dry=9;
9 n = 9;
10 intra = zeros(n,n);
11 intra(Mildew, LAI)=1;
12 intra(LAI,[Micro Photo])=1;
13 intra(Precip,Micro)=1;
14 intra(Temp,[Micro Photo])=1;
15 intra(Solar,Photo)=1;
16 intra(Photo,Dry)=1;
17
18 inter = zeros(n,n);
19 inter(Fungi,Mildew)=1;
20 inter(Mildew,Mildew)=1;
21 inter(LAI,LAI)=1;
22 inter(Micro,Mildew)=1;
23 inter(Dry,Dry)=1;
24
25 ns = 2*ones(1,n);
26 bnet = mk_dbn(intra, inter, ns, 'observed', [Photo]);
27
28 for e=1:max(bnet.equiv_class(:))
29 i = bnet.rep_of_eclass(e);
30 bnet.CPD{e} = tabular_CPD(bnet,i);
31 end