Mercurial > hg > camir-ismir2012
diff toolboxes/FullBNT-1.0.7/bnt/inference/dynamic/@hmm_inf_engine/marginal_nodes.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolboxes/FullBNT-1.0.7/bnt/inference/dynamic/@hmm_inf_engine/marginal_nodes.m Fri Aug 19 13:07:06 2016 +0200 @@ -0,0 +1,29 @@ +function marginal = marginal_nodes(engine, nodes, t, add_ev) +% MARGINAL_NODES Compute the marginal on the specified query nodes (hmm) +% marginal = marginal_nodes(engine, nodes, t, add_ev) +% +% 'nodes' must be a single node. +% t is the time slice. + +if nargin < 3, t = 1; end +if nargin < 4, add_ev = 0; end + +assert(length(nodes)==1) +ss = engine.slice_size; + +i = nodes(1); +bigT = engine.one_slice_marginal(:,t); +dom = i + (t-1)*ss; + +ns = engine.eff_node_sizes(:); +bigdom = 1:ss; +marginal.T = marg_table(bigT, bigdom + (t-1)*ss, ns(bigdom), dom, engine.maximize); + +marginal.domain = dom; +marginal.mu = []; +marginal.Sigma = []; + +if add_ev + marginal = add_ev_to_dmarginal(marginal, engine.evidence, engine.node_sizes); +end +