Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/potentials/check_for_cd_arcs.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 check_for_cd_arcs(onodes, cnodes, dag) | |
2 % CHECK_FOR_CD_ARCS Raise an error if there are any C->D links where the C node is hidden. | |
3 % check_for_cd_arcs(onodes, cnodes, dag) | |
4 % | |
5 % We cannot convert the logistic/softmax function (C->D CPD) to a Gaussian potential | |
6 % unless we use the variational approximation discussed in | |
7 % "A variational approximation for Bayesian networks with discrete and continuous latent | |
8 % variables", K. Murphy, UAI 1999. | |
9 | |
10 n = length(dag); | |
11 hnodes = mysetdiff(1:n, onodes); | |
12 chid = myintersect(cnodes, hnodes); | |
13 dnodes = mysetdiff(1:n, cnodes); | |
14 for i=chid(:)' | |
15 dcs = myintersect(children(dag, i), dnodes); | |
16 if ~isempty(dcs) | |
17 error(['hidden cts node ' num2str(i) ' has a discrete child']); | |
18 end | |
19 end | |
20 | |
21 | |
22 | |
23 |