comparison toolboxes/FullBNT-1.0.7/bnt/general/do_intervention.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function bnet = mutilate_bnet(bnet, nodes, vals)
2 % MUTILATE_BNET Clamp nodes to specific values (perform a surgical intervention)
3 % bnet = mutilate_bnet(bnet, nodes, vals)
4 %
5 % We make all the clamped nodes roots.
6
7 ns = bnet.node_sizes;
8 for i=1:length(nodes)
9 X = nodes(i);
10 x = vals(i);
11 bnet.dag(:,X) = 0;
12 bnet.CPD{X} = root_CPD(bnet, X, x);
13 end