annotate toolboxes/FullBNT-1.0.7/bnt/inference/static/@stab_cond_gauss_inf_engine/marginal_singleclq_nodes.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 = marginal_singleclq_nodes(engine, i, query)
wolffd@0 2 % MARGINAL_SINGLECLQ_NODES get the marginal distribution of nodes which is in a single clique
wolffd@0 3 % marginal = marginal_singleclq_nodes(engine, i, query)
wolffd@0 4
wolffd@0 5 pot = struct(engine.clpot{i});
wolffd@0 6 if isempty(pot.ctaildom)
wolffd@0 7 if i ~= engine.root
wolffd@0 8 p = parents(engine.jtree, i);
wolffd@0 9 tpot = direct_combine_pots(engine.clpot{i}, engine.seppot{p, i});
wolffd@0 10 else
wolffd@0 11 tpot = engine.clpot{i};
wolffd@0 12 end
wolffd@0 13 pot = marginalize_pot(tpot, query);
wolffd@0 14
wolffd@0 15 marginal = pot_to_marginal(pot);
wolffd@0 16 marginal.T = normalise(marginal.T);
wolffd@0 17 else
wolffd@0 18 [engine, clqtoroot] = push(engine, i, query);
wolffd@0 19 if clqtoroot == engine.root
wolffd@0 20 tpot = engine.clpot{clqtoroot};
wolffd@0 21 else
wolffd@0 22 p = parents(engine.jtree, clqtoroot);
wolffd@0 23 tpot = direct_combine_pots(engine.clpot{clqtoroot}, engine.seppot{p, clqtoroot});
wolffd@0 24 end
wolffd@0 25 pot = marginalize_pot(tpot, query);
wolffd@0 26
wolffd@0 27 marginal = pot_to_marginal(pot);
wolffd@0 28 marginal.T = normalise(marginal.T);
wolffd@0 29 end
wolffd@0 30