wolffd@0: function y = sample_node(CPD, pev) wolffd@0: % SAMPLE_NODE Draw a random sample from P(Y|pa(y), theta) (root) wolffd@0: % Y = SAMPLE_NODE(CPD, PEV) wolffd@0: % wolffd@0: % pev{i} is the evidence on the i'th parent. wolffd@0: % Since a root has no parents, we ignore pev, wolffd@0: % and return the value the root was clamped to when it was created. wolffd@0: wolffd@0: y = CPD.val;