about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/CPDs/@root_CPD/sample_node.m
blob: 5ced75f481b56b50a11a962083b760234aaaa137 (plain)
1
2
3
4
5
6
7
8
9
function y = sample_node(CPD, pev)
% SAMPLE_NODE Draw a random sample from P(Y|pa(y), theta)  (root)
% Y = SAMPLE_NODE(CPD, PEV)
%
% pev{i} is the evidence on the i'th parent.
% Since a root has no parents, we ignore pev,
% and return the value the root was clamped to when it was created.

y = CPD.val;