annotate toolboxes/FullBNT-1.0.7/bnt/potentials/CPD_to_pot.m @ 0:cc4b1211e677
tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author |
Daniel Wolff |
date |
Fri, 19 Aug 2016 13:07:06 +0200 |
parents |
|
children |
|
rev |
line source |
Daniel@0
|
1 function pot = CPD_to_pot(pot_type, CPD, domain, ns, cnodes, evidence)
|
Daniel@0
|
2 % CPD_TO_POT Convert a CPD to a potential of the specified form, incorporating any evidence
|
Daniel@0
|
3 % pot = CPD_to_pot(pot_type, CPD, domain, node_sizes, cnodes, evidence)
|
Daniel@0
|
4 %
|
Daniel@0
|
5 % pot_type is one of 'd', 'g', or 'cg'.
|
Daniel@0
|
6 % domain is the domain of CPD.
|
Daniel@0
|
7 % node_sizes(i) is the size of node i.
|
Daniel@0
|
8 % cnodes = the cts nodes
|
Daniel@0
|
9 % evidence{i} is the evidence on the i'th node.
|
Daniel@0
|
10
|
Daniel@0
|
11 switch pot_type
|
Daniel@0
|
12 case 'd',
|
Daniel@0
|
13 pot = CPD_to_dpot(CPD, domain, ns, cnodes, evidence);
|
Daniel@0
|
14 case 'g',
|
Daniel@0
|
15 pot = CPD_to_cpot(CPD, domain, ns, cnodes, evidence);
|
Daniel@0
|
16 case 'cg',
|
Daniel@0
|
17 pot = CPD_to_cgpot(CPD, domain, ns, cnodes, evidence);
|
Daniel@0
|
18 otherwise,
|
Daniel@0
|
19 error(['can''t handle pot_type ' pot_type]);
|
Daniel@0
|
20 end
|
Daniel@0
|
21
|