ReverseLink {RNetica} | R Documentation |
This reverses the link between parent and child so that it now points from child to parent. If child has additional parents, they are connected to parent and the conditional probability tables are adjusted so that the joint probability distribution across all nodes in the network remains the same.
ReverseLink(parent, child)
parent |
An active |
child |
An active |
This is not just a simple reversal of a single edge, but rather the
influence diagram operation of arc reversal. Netica will add
additional links to enforce any conditional probability relationship.
For example, Consider a net where A
and B
are both
parents of C
, but A
is not directly connected to
C
. After reversing the arc between B
and C
,
A
will also become a parent of B
to maintain the joint
distribution.
Returns NULL
if successful and NA
if there was a problem.
Russell Almond
http://norsys.com/onLineAPIManual/index.html: ReverseLink_bn()
Shachter, R. D. (1986) "Evaluating Influence Diagrams." Operations Research, 34, 871–82.
NeticaNode
, AddLink()
,
NodeChildren()
, NodeParents()
,
AbsorbNodes()
, is.NodeRelated()
sess <- NeticaSession() startSession(sess) abcnet <- CreateNetwork("ABC", session=sess) A <- NewDiscreteNode(abcnet,"A") B <- NewDiscreteNode(abcnet,"B") C <- NewDiscreteNode(abcnet,"C") AddLink(A,C) AddLink(B,C) stopifnot( is.NodeRelated(A,C,"parent"), is.NodeRelated(C,B,"child"), !is.NodeRelated(A,B,"parent") ) ReverseLink(B,C) stopifnot( is.NodeRelated(A,C,"parent"), is.NodeRelated(C,B,"parent"), is.NodeRelated(A,B,"parent") ) DeleteNetwork(abcnet) stopSession(sess)