Daniel@0: function [marginal, pot] = marginal_nodes(engine, query) Daniel@0: % MARGINAL_NODES Compute the marginal on the specified query nodes (belprop) Daniel@0: % [marginal, pot] = marginal_nodes(engine, query) Daniel@0: % Daniel@0: % query must be a subset of a family Daniel@0: Daniel@0: if isempty(query) Daniel@0: big_pot = engine.marginal_domains{1}; % pick an arbitrary domain Daniel@0: else Daniel@0: big_pot = engine.marginal_domains{query(end)}; Daniel@0: end Daniel@0: pot = marginalize_pot(big_pot, query); Daniel@0: marginal = pot_to_marginal(pot); Daniel@0: