wolffd@0: function marginal = dbn_marginal_from_bel(engine, i) wolffd@0: % DBN_MARGINAL_FROM_BEL Compute the marginal on a node given the current belief state (bk) wolffd@0: % marginal = dbn_marginal_from_bel(engine, i) wolffd@0: wolffd@0: if engine.slice1 wolffd@0: j = i; wolffd@0: c = clq_containing_nodes(engine.sub_engine1, j); wolffd@0: else wolffd@0: bnet = bnet_from_engine(engine); wolffd@0: ss = length(bnet.intra); wolffd@0: j = i+ss; wolffd@0: c = clq_containing_nodes(engine.sub_engine, j); wolffd@0: end wolffd@0: assert(c >= 1); wolffd@0: bigpot = engine.bel_clpot{c}; wolffd@0: wolffd@0: pot = marginalize_pot(bigpot, j); wolffd@0: marginal = pot_to_marginal(pot);