annotate toolboxes/FullBNT-1.0.7/bnt/inference/dynamic/@bk_inf_engine/dbn_marginal_from_bel.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 marginal = dbn_marginal_from_bel(engine, i)
wolffd@0 2 % DBN_MARGINAL_FROM_BEL Compute the marginal on a node given the current belief state (bk)
wolffd@0 3 % marginal = dbn_marginal_from_bel(engine, i)
wolffd@0 4
wolffd@0 5 if engine.slice1
wolffd@0 6 j = i;
wolffd@0 7 c = clq_containing_nodes(engine.sub_engine1, j);
wolffd@0 8 else
wolffd@0 9 bnet = bnet_from_engine(engine);
wolffd@0 10 ss = length(bnet.intra);
wolffd@0 11 j = i+ss;
wolffd@0 12 c = clq_containing_nodes(engine.sub_engine, j);
wolffd@0 13 end
wolffd@0 14 assert(c >= 1);
wolffd@0 15 bigpot = engine.bel_clpot{c};
wolffd@0 16
wolffd@0 17 pot = marginalize_pot(bigpot, j);
wolffd@0 18 marginal = pot_to_marginal(pot);