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