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