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