Daniel@0: function marginal = marginal_nodes(engine, nodes, t, add_ev) Daniel@0: % MARGINAL_NODES Compute the marginal on the specified query nodes (hmm) Daniel@0: % marginal = marginal_nodes(engine, nodes, t, add_ev) Daniel@0: % Daniel@0: % 'nodes' must be a single node. Daniel@0: % t is the time slice. Daniel@0: Daniel@0: if nargin < 3, t = 1; end Daniel@0: if nargin < 4, add_ev = 0; end Daniel@0: Daniel@0: assert(length(nodes)==1) Daniel@0: ss = engine.slice_size; Daniel@0: Daniel@0: i = nodes(1); Daniel@0: bigT = engine.one_slice_marginal(:,t); Daniel@0: dom = i + (t-1)*ss; Daniel@0: Daniel@0: ns = engine.eff_node_sizes(:); Daniel@0: bigdom = 1:ss; Daniel@0: marginal.T = marg_table(bigT, bigdom + (t-1)*ss, ns(bigdom), dom, engine.maximize); Daniel@0: Daniel@0: marginal.domain = dom; Daniel@0: marginal.mu = []; Daniel@0: marginal.Sigma = []; Daniel@0: Daniel@0: if add_ev Daniel@0: marginal = add_ev_to_dmarginal(marginal, engine.evidence, engine.node_sizes); Daniel@0: end Daniel@0: