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