Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/CPDs/@noisyor_CPD/CPD_to_lambda_msg.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function lam_msg = CPD_to_lambda_msg(CPD, msg_type, n, ps, msg, p, evidence) | |
2 % CPD_TO_LAMBDA_MSG Compute lambda message (noisyor) | |
3 % lam_msg = CPD_to_lambda_msg(CPD, msg_type, n, ps, msg, p) | |
4 % Pearl p190 top eqn | |
5 | |
6 switch msg_type | |
7 case 'd', | |
8 l0 = msg{n}.lambda(1); | |
9 l1 = msg{n}.lambda(2); | |
10 Pi = sum_prod_CPD_and_pi_msgs(CPD, n, ps, msg, p); | |
11 i = find(p==ps); % p is n's i'th parent | |
12 q = CPD.inhibit(i); | |
13 lam_msg = zeros(2,1); | |
14 for u=0:1 | |
15 lam_msg(u+1) = l1 - (q^u)*(l1 - l0)*Pi; | |
16 end | |
17 case 'g', | |
18 error('noisyor_CPD can''t create Gaussian msgs') | |
19 end |