Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/potentials/determine_pot_type.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 pot_type = determine_pot_type(model, onodes, nodes) | |
2 % DETERMINE_POT_TYPE Determine the type of potential based on the evidence pattern. | |
3 % pot_type = determine_pot_type(model, onodes, nodes) | |
4 % | |
5 % If there are any utility nodes, pot_type = 'u' | |
6 % else | |
7 % If all hidden nodes are discrete, pot_type = 'd'. | |
8 % If all hidden nodes are continuous, pot_type = 'g' (Gaussian). | |
9 % If some hidden nodes are discrete, and some cts, pot_type = 'cg' (conditional Gaussian). | |
10 % | |
11 % nodes defaults to all nodes in graph | |
12 | |
13 nnodes = length(model.node_sizes); | |
14 if nargin < 3, nodes = 1:nnodes; end | |
15 | |
16 hnodes = mysetdiff(nodes, onodes); | |
17 if isfield(model, 'limid') %~isempty(model.utility_nodes) | |
18 pot_type = 'u'; | |
19 elseif isempty(myintersect(model.cnodes, hnodes)) | |
20 pot_type = 'd'; | |
21 elseif mysubset(hnodes, model.cnodes) | |
22 pot_type = 'g'; | |
23 else | |
24 pot_type = 'cg'; | |
25 end |