Copyright Tristan Aubrey-Jones April 2007.
function event = model1();
% NETWORK1 is the first bayesian network
% shown in figure 1 of the coursework.
%% A
a = brand(0.2);
%% B
if (a == 1), b = brand(0.25);
else b = brand(0.05);
end
%% C
if (a == 1), c = brand(0.1);
else c = brand(0.05);
end
%% D
if (b == 1)
if (c == 1), d = brand(0.75);
else d = brand(0.1);
end
else
if (c == 1), d = brand(0.5);
else d = brand(0.05);
end
end
%% E
if (c == 1), e = brand(0.6);
else e = brand(0.05);
end
%% assign to result
event = [a b c d e];