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 / do_intervention.m @ 8:b5b38998ef3b

History | View | Annotate | Download (352 Bytes)

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