To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / _FullBNT / BNT / general / Old / compute_interface_nodes.m @ 8:b5b38998ef3b

History | View | Annotate | Download (1.07 KB)

1
function [int, persist, transient] = compute_interface_nodes(intra, inter)
2
% COMPUTE_INTERFACE_NODES Find the nodes in a DBN that represent a sufficient statistic
3
% [int, persist, transient] = compute_interface_nodes(intra, inter)
4
%
5
% The interface nodes are all those that has an incoming temporal arc,
6
% or which have a child which has an incoming temporal arc,
7
% where a temporal arc means one coming from the previous slice.
8
% (The parents of nodes with incoming temporal arcs are needed
9
% because moralization will bring them into the clique.)
10
%
11
% The persisent nodes are all those that have one or more incoming temporal arc.
12
% The transient nodes are all the non-persistent.
13
%
14
% See U. Kjaerulff, "dHugin: A computational system for dynamic
15
% time-sliced Bayesian networks", Intl. J. Forecasting (11) 89-111, 1995
16

    
17
n = length(intra);
18
int = [];
19
persist = [];
20
for u=1:n
21
  if any(inter(:,u))
22
    int = [int u];
23
    persist = [persist u];
24
  end
25
  if any(inter(:, children(intra, u)))
26
    int = [int u];
27
  end
28
end
29
int = unique(int);
30
persist = unique(persist);
31
transient = mysetdiff(1:n, persist);