annotate toolboxes/FullBNT-1.0.7/bnt/general/Old/compute_interface_nodes.m @ 0:cc4b1211e677
tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author |
Daniel Wolff |
date |
Fri, 19 Aug 2016 13:07:06 +0200 |
parents |
|
children |
|
rev |
line source |
Daniel@0
|
1 function [int, persist, transient] = compute_interface_nodes(intra, inter)
|
Daniel@0
|
2 % COMPUTE_INTERFACE_NODES Find the nodes in a DBN that represent a sufficient statistic
|
Daniel@0
|
3 % [int, persist, transient] = compute_interface_nodes(intra, inter)
|
Daniel@0
|
4 %
|
Daniel@0
|
5 % The interface nodes are all those that has an incoming temporal arc,
|
Daniel@0
|
6 % or which have a child which has an incoming temporal arc,
|
Daniel@0
|
7 % where a temporal arc means one coming from the previous slice.
|
Daniel@0
|
8 % (The parents of nodes with incoming temporal arcs are needed
|
Daniel@0
|
9 % because moralization will bring them into the clique.)
|
Daniel@0
|
10 %
|
Daniel@0
|
11 % The persisent nodes are all those that have one or more incoming temporal arc.
|
Daniel@0
|
12 % The transient nodes are all the non-persistent.
|
Daniel@0
|
13 %
|
Daniel@0
|
14 % See U. Kjaerulff, "dHugin: A computational system for dynamic
|
Daniel@0
|
15 % time-sliced Bayesian networks", Intl. J. Forecasting (11) 89-111, 1995
|
Daniel@0
|
16
|
Daniel@0
|
17 n = length(intra);
|
Daniel@0
|
18 int = [];
|
Daniel@0
|
19 persist = [];
|
Daniel@0
|
20 for u=1:n
|
Daniel@0
|
21 if any(inter(:,u))
|
Daniel@0
|
22 int = [int u];
|
Daniel@0
|
23 persist = [persist u];
|
Daniel@0
|
24 end
|
Daniel@0
|
25 if any(inter(:, children(intra, u)))
|
Daniel@0
|
26 int = [int u];
|
Daniel@0
|
27 end
|
Daniel@0
|
28 end
|
Daniel@0
|
29 int = unique(int);
|
Daniel@0
|
30 persist = unique(persist);
|
Daniel@0
|
31 transient = mysetdiff(1:n, persist);
|