about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/Old/update_CPT.m
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/Old/update_CPT.m')
-rw-r--r--sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/Old/update_CPT.m13
1 files changed, 13 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/Old/update_CPT.m b/sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/Old/update_CPT.m
new file mode 100644
index 00000000..4ce14d9f
--- /dev/null
+++ b/sourcecodes/bnt-master/BNT/CPDs/@hhmmF_CPD/Old/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.Qsizes(CPD.Q);
+Qpsz = prod(CPD.Qsizes(CPD.Qps));
+
+% P(Q(1:d-1), Q(d), F(d+1), F(d))
+CPT = zeros(Qpsz, Qsz, 2, 2);
+CPT(:,:,1,1) = 1; % if F(d+1)=1, then F(d)=1
+CPT(:,:,2,:) = CPD.termprob;
+
+CPD = set_fields(CPD, 'CPT', CPT);