Mercurial > hg > camir-aes2014
annotate toolboxes/FullBNT-1.0.7/bnt/inference/static/@jtree_limid_inf_engine/enter_evidence.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
rev | line source |
---|---|
wolffd@0 | 1 function engine = enter_evidence(engine, evidence, varargin) |
wolffd@0 | 2 % ENTER_EVIDENCE Add the specified evidence to the network (jtree_limid) |
wolffd@0 | 3 % engine = enter_evidence(engine, evidence, ...) |
wolffd@0 | 4 % |
wolffd@0 | 5 % evidence{i} = [] if if X(i) is hidden, and otherwise contains its observed value. |
wolffd@0 | 6 % |
wolffd@0 | 7 % The list below gives optional arguments [default value in brackets]. |
wolffd@0 | 8 % |
wolffd@0 | 9 % exclude - list of nodes whose potential will not be included in the joint [ [] ] |
wolffd@0 | 10 % |
wolffd@0 | 11 % e.g., engine = enter_evidence(engine, ev, 'exclude', 3) |
wolffd@0 | 12 |
wolffd@0 | 13 exclude = []; |
wolffd@0 | 14 |
wolffd@0 | 15 if nargin >= 3 |
wolffd@0 | 16 args = varargin; |
wolffd@0 | 17 nargs = length(args); |
wolffd@0 | 18 for i=1:2:nargs |
wolffd@0 | 19 switch args{i}, |
wolffd@0 | 20 case 'exclude', exclude = args{i+1}; |
wolffd@0 | 21 otherwise, |
wolffd@0 | 22 error(['invalid argument name ' args{i}]); |
wolffd@0 | 23 end |
wolffd@0 | 24 end |
wolffd@0 | 25 end |
wolffd@0 | 26 |
wolffd@0 | 27 engine.exclude = exclude; |
wolffd@0 | 28 engine.evidence = evidence; |