wolffd@0: function [engine, loglik] = dbn_update_bel1(engine, evidence) wolffd@0: % DBN_UPDATE_BEL1 Update the initial belief state (bk) wolffd@0: % engine = dbn_update_bel1(engine, evidence) wolffd@0: % wolffd@0: % evidence{i} has the evidence on node i for slice 1 wolffd@0: wolffd@0: bnet = bnet_from_engine(engine); wolffd@0: ss = length(bnet.intra); wolffd@0: CPDpot = cell(1,ss); wolffd@0: t = 1; wolffd@0: for n=1:ss wolffd@0: fam = family(bnet.dag, n); wolffd@0: e = bnet.equiv_class(n, 1); wolffd@0: CPDpot{n} = convert_to_pot(bnet.CPD{e}, engine.pot_type, fam(:), evidence); wolffd@0: end wolffd@0: wolffd@0: onodes = find(~isemptycell(evidence)); wolffd@0: wolffd@0: [clpot, loglik] = enter_soft_evidence(engine.sub_engine1, engine.clq_ass_to_node1, CPDpot, onodes, engine.pot_type); wolffd@0: wolffd@0: C = length(engine.clusters); wolffd@0: newbel = cell(1,C); wolffd@0: for c=1:C wolffd@0: k = engine.clq_ass_to_cluster1(c); wolffd@0: newbel{c} = marginalize_pot(clpot{k}, engine.clusters{c}); wolffd@0: end wolffd@0: wolffd@0: engine.bel = newbel; wolffd@0: engine.bel_clpot = clpot; wolffd@0: engine.slice1 = 1;