Mercurial > hg > mauch-mirex-2010
annotate _FullBNT/BNT/CPDs/@discrete_CPD/CPD_to_lambda_msg.m @ 9:4ea6619cb3f5 tip
removed log files
author | matthiasm |
---|---|
date | Fri, 11 Apr 2014 15:55:11 +0100 |
parents | b5b38998ef3b |
children |
rev | line source |
---|---|
matthiasm@8 | 1 function lam_msg = CPD_to_lambda_msg(CPD, msg_type, n, ps, msg, p, evidence) |
matthiasm@8 | 2 % CPD_TO_LAMBDA_MSG Compute lambda message (discrete) |
matthiasm@8 | 3 % lam_msg = compute_lambda_msg(CPD, msg_type, n, ps, msg, p, evidence) |
matthiasm@8 | 4 % Pearl p183 eq 4.52 |
matthiasm@8 | 5 |
matthiasm@8 | 6 switch msg_type |
matthiasm@8 | 7 case 'd', |
matthiasm@8 | 8 T = prod_CPT_and_pi_msgs(CPD, n, ps, msg, p); |
matthiasm@8 | 9 mysize = length(msg{n}.lambda); |
matthiasm@8 | 10 lambda = dpot(n, mysize, msg{n}.lambda); |
matthiasm@8 | 11 T = multiply_by_pot(T, lambda); |
matthiasm@8 | 12 lam_msg = pot_to_marginal(marginalize_pot(T, p)); |
matthiasm@8 | 13 lam_msg = lam_msg.T; |
matthiasm@8 | 14 case 'g', |
matthiasm@8 | 15 error('discrete_CPD can''t create Gaussian msgs') |
matthiasm@8 | 16 end |