comparison toolboxes/FullBNT-1.0.7/bnt/inference/dynamic/@pearl_dbn_inf_engine/marginal_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_nodes(engine, nodes, t)
2 % MARGINAL_NODES Compute the marginal on the specified query nodes (pearl_dbn)
3 % marginal = marginal_nodes(engine, i, t)
4 % returns Pr(X(i,t) | Y(1:T)), where X(i,t) is the i'th node in the t'th slice.
5 % If enter_evidence used filtering instead of smoothing, this will return Pr(X(i,t) | Y(1:t)).
6
7 if nargin < 3, t = 1; end
8 assert(length(nodes)==1);
9 i = nodes(end);
10 if ~myismember(i, engine.onodes)
11 marginal.T = engine.marginal{i,t};
12 else
13 marginal.T = 1; % observed
14 end
15
16 % we convert the domain to the unrolled numbering system
17 % so that update_ess extracts the right evidence.
18 marginal.domain = nodes+(t-1)*engine.ss;