ReverseLink {RNetica}R Documentation

Reverses a link in a Netica network.

Description

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.

Usage

ReverseLink(parent, child)

Arguments

parent

An active NeticaNode which is currently a parent of child and which will be the child after the transformation.

child

An active NeticaNode which is currently a child of parent and which will be the parent after the transformation.

Details

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.

Value

Returns NULL if successful and NA if there was a problem.

Author(s)

Russell Almond

References

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

Shachter, R. D. (1986) "Evaluating Influence Diagrams." Operations Research, 34, 871–82.

See Also

NeticaNode, AddLink(), NodeChildren(), NodeParents(), AbsorbNodes(), is.NodeRelated()

Examples

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)


[Package RNetica version 0.5-4 Index]