wolffd@0: function [interface, persist, transient] = compute_interface_nodes(intra, inter) wolffd@0: % COMPUTE_INTERFACE_NODES Find the nodes in a DBN that represent a sufficient statistic wolffd@0: % [interface, persist, transient] = compute_interface_nodes(intra, inter) wolffd@0: % wolffd@0: % The interface nodes are all those that has an incoming temporal arc, wolffd@0: % or which are parents of such nodes. wolffd@0: % If the parents are in the previous slice, this just means they have an wolffd@0: % outgoing temporal arc. wolffd@0: % (The parents of nodes with incoming temporal arcs are needed wolffd@0: % because moralization will bring them into the clique.) wolffd@0: % wolffd@0: % The persisent nodes are all those that have one or more incoming temporal arc. wolffd@0: % The transient nodes are all the non-persistent. wolffd@0: % wolffd@0: % See U. Kjaerulff, "dHugin: A computational system for dynamic wolffd@0: % time-sliced Bayesian networks", Intl. J. Forecasting (11) 89-111, 1995 wolffd@0: wolffd@0: n = length(intra); wolffd@0: interface = []; wolffd@0: persist = []; wolffd@0: % any nodes with incoming arcs wolffd@0: for u=1:n wolffd@0: if any(inter(:,u)) wolffd@0: interface = [interface u]; wolffd@0: persist = [persist u]; wolffd@0: end wolffd@0: end wolffd@0: % Any nodes which are parents of nodes with incoming arcs wolffd@0: for u=1:n wolffd@0: cs = children(intra, u); wolffd@0: if any(inter(:, cs)) wolffd@0: interface = [interface u]; wolffd@0: end wolffd@0: %cs = children(inter, u); wolffd@0: % if ~isempty(myintersect(cs, persist)) wolffd@0: % interface = [interface u]; wolffd@0: %end wolffd@0: end wolffd@0: interface = unique(interface); wolffd@0: persist = unique(persist); wolffd@0: transient = mysetdiff(1:n, persist); wolffd@0: