Daniel@0: function [pot, loglik] = normalize_pot(pot) Daniel@0: % NORMALIZE_POT Convert the canonical potential Pr(X,E) into Pr(X|E) and return log Pr(E). Daniel@0: % [pot, loglik] = normalize_pot(pot) Daniel@0: Daniel@0: mom = cpot_to_mpot(pot); % move the normalizing constant out of g, to reveal the coefficient Daniel@0: %loglik = scaling_factor_pot(mom); Daniel@0: %loglik = mom.logp; Daniel@0: [temp, loglik] = normalize_pot(mom); Daniel@0: pot.g = pot.g - loglik; Daniel@0: