blob: 5d874803bfa428167381209b8e3f66b0e4c379e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
function engine = enter_evidence(engine, evidence, varargin)
% ENTER_EVIDENCE Add the specified evidence to the network (jtree_limid)
% engine = enter_evidence(engine, evidence, ...)
%
% evidence{i} = [] if if X(i) is hidden, and otherwise contains its observed value.
%
% The list below gives optional arguments [default value in brackets].
%
% exclude - list of nodes whose potential will not be included in the joint [ [] ]
%
% e.g., engine = enter_evidence(engine, ev, 'exclude', 3)
exclude = [];
if nargin >= 3
args = varargin;
nargs = length(args);
for i=1:2:nargs
switch args{i},
case 'exclude', exclude = args{i+1};
otherwise,
error(['invalid argument name ' args{i}]);
end
end
end
engine.exclude = exclude;
engine.evidence = evidence;
|