IsNodeDeterministic {RNetica}R Documentation

Determines if a node in a Netica Network is deterministic or not.

Description

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.

Usage

IsNodeDeterministic(node)

Arguments

node

An active NeticaNode whose conditional probability table is to be tested.

Details

For discrete nodes, this returns TRUE if all the conditional probabilities are zero or one. It returns FALSE otherwise.

Value

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.

Author(s)

Russell Almond

References

http://norsys.com/onLineAPIManual/index.html: IsNodeDeterministic_bn()

See Also

NeticaNode, NodeParents(), NodeInputNames(), NodeStates()

Examples

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)


[Package RNetica version 0.5-4 Index]