wolffd@0: function [int, 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: % [int, 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 have a child which has an incoming temporal arc, wolffd@0: % where a temporal arc means one coming from the previous slice. 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: int = []; wolffd@0: persist = []; wolffd@0: for u=1:n wolffd@0: if any(inter(:,u)) wolffd@0: int = [int u]; wolffd@0: persist = [persist u]; wolffd@0: end wolffd@0: if any(inter(:, children(intra, u))) wolffd@0: int = [int u]; wolffd@0: end wolffd@0: end wolffd@0: int = unique(int); wolffd@0: persist = unique(persist); wolffd@0: transient = mysetdiff(1:n, persist);