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