wolffd@0: function [m, pot] = marginal_nodes(engine, query) wolffd@0: % MARGINAL_NODES Compute the marginal on the specified nodes (jtree_limid) wolffd@0: % [m, pot] = marginal_nodes(engine, query) wolffd@0: % wolffd@0: % query should be a subset of a family of a decision node wolffd@0: wolffd@0: if isempty(query) wolffd@0: bnet = bnet_from_engine(engine); wolffd@0: d = bnet.decision_nodes(1); % pick an arbitrary decision node wolffd@0: [dummy, big_pot] = marginal_family(engine, d); wolffd@0: else wolffd@0: [dummy, big_pot] = marginal_family(engine, query); wolffd@0: end wolffd@0: pot = marginalize_pot(big_pot, query); wolffd@0: m = pot_to_marginal(pot); wolffd@0: wolffd@0: