IsNodeDeterministic {RNetica} | R Documentation |
A node in a Bayesian network is deterministic if its value is determined by the states of its parents, that is if all conditional probabilities are 0 or 1.
IsNodeDeterministic(node)
node |
An active |
For discrete nodes, this returns TRUE
if all the conditional
probabilities are zero or one. It returns FALSE
otherwise.
TRUE
if the conditional probability table for node
is
deterministic, FALSE
otherwise. If the node is not active, or
there is otherwise an error it returns NA
.
Russell Almond
http://norsys.com/onLineAPIManual/index.html: IsNodeDeterministic_bn()
NeticaNode
, NodeParents()
,
NodeInputNames()
, NodeStates()
sess <- NeticaSession() startSession(sess) ab <- CreateNetwork("AB", session=sess) A <- NewDiscreteNode(ab,"A",c("A1","A2","A3")) B <- NewDiscreteNode(ab,"B",c("B1","B2")) AddLink(A,B) ##Undefined node is not deterministic. stopifnot(!IsNodeDeterministic(A)) NodeProbs(A) <- c(0,1,0) stopifnot(IsNodeDeterministic(A)) NodeProbs(A) <- c(1/3,1/3,1/3) stopifnot(!IsNodeDeterministic(A)) NodeProbs(B) <- rbind(c(0,1), c(0,1), c(1,0)) stopifnot(IsNodeDeterministic(B)) DeleteNetwork(ab) stopSession(sess)