about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/update_CPT.m
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/update_CPT.m')
-rw-r--r--sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/update_CPT.m13
1 files changed, 13 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/update_CPT.m b/sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/update_CPT.m
new file mode 100644
index 00000000..1250457e
--- /dev/null
+++ b/sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/update_CPT.m
@@ -0,0 +1,13 @@
+function CPD = update_CPT(CPD)
+% Compute the big CPT for an HHMM F node given internal termprob
+% function CPD = update_CPT(CPD)
+
+Qsz = CPD.Qsz;
+Qpsz = CPD.Qpsz;
+
+% CPT(Qpsz, Q, Fbelow, Fself)
+CPT = zeros(Qpsz, Qsz, 2, 2);
+CPT(:,:,1,1) = 1; % if Fbelow=1 (off), then Fself=1 (off)
+CPT(:,:,2,:) = CPD.termprob;
+
+CPD = set_fields(CPD, 'CPT', CPT);