annotate toolboxes/FullBNT-1.0.7/bnt/general/Old/compute_interface_nodes.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function [int, persist, transient] = compute_interface_nodes(intra, inter)
wolffd@0 2 % COMPUTE_INTERFACE_NODES Find the nodes in a DBN that represent a sufficient statistic
wolffd@0 3 % [int, persist, transient] = compute_interface_nodes(intra, inter)
wolffd@0 4 %
wolffd@0 5 % The interface nodes are all those that has an incoming temporal arc,
wolffd@0 6 % or which have a child which has an incoming temporal arc,
wolffd@0 7 % where a temporal arc means one coming from the previous slice.
wolffd@0 8 % (The parents of nodes with incoming temporal arcs are needed
wolffd@0 9 % because moralization will bring them into the clique.)
wolffd@0 10 %
wolffd@0 11 % The persisent nodes are all those that have one or more incoming temporal arc.
wolffd@0 12 % The transient nodes are all the non-persistent.
wolffd@0 13 %
wolffd@0 14 % See U. Kjaerulff, "dHugin: A computational system for dynamic
wolffd@0 15 % time-sliced Bayesian networks", Intl. J. Forecasting (11) 89-111, 1995
wolffd@0 16
wolffd@0 17 n = length(intra);
wolffd@0 18 int = [];
wolffd@0 19 persist = [];
wolffd@0 20 for u=1:n
wolffd@0 21 if any(inter(:,u))
wolffd@0 22 int = [int u];
wolffd@0 23 persist = [persist u];
wolffd@0 24 end
wolffd@0 25 if any(inter(:, children(intra, u)))
wolffd@0 26 int = [int u];
wolffd@0 27 end
wolffd@0 28 end
wolffd@0 29 int = unique(int);
wolffd@0 30 persist = unique(persist);
wolffd@0 31 transient = mysetdiff(1:n, persist);