RetractNodeFinding {RNetica}R Documentation

Clears any findings for a Netica node or network.

Description

The function RetractNodeFinding(node) clears any findings or virtual findings set with NodeFinding(), EnterNegativeFinding() or NodeLikelihood() and associated with node. The function RetractNetFindings(net) clears any findings associated with any node in the network.

Usage

RetractNodeFinding(node)
RetractNetFindings(net)

Arguments

node

An active NeticaNode whose findings are to be retracted.

net

An active NeticaBN whose findings are to be retracted.

Details

This is an undo function for NodeFinding(), EnterNegativeFinding() or NodeLikelihood(). In particular, it allows for entering hypothesized findings for various calculations.

Value

Returns its argument invisibly.

Note

If SetNetworkAutoUpdate() has been set to TRUE, then this function could take some time as each finding is individually propagated. Consider wrapping multiple calls setting NodeFinding() in WithoutAutoUpdate(net, ...).

The Netica functions for setting node findings require the programmer to call RetractNodeFindings_bn() before setting values to clear out old findings. The RNetica functions do this internally, so the user does not need to worry about this.

Author(s)

Russell Almond

References

http://norsys.com/onLineAPIManual/index.html: RetractNetFindings_bn(), RetractNodeFindings_bn()

See Also

NeticaBN, NeticaNode, NodeBeliefs(), EnterNegativeFinding(), EnterGaussianFinding(), EnterIntervalFinding(), NodeFinding(), NodeLikelihood()

Examples

sess <- NeticaSession()
startSession(sess)
irt5 <- ReadNetworks(file.path(library(help="RNetica")$path,
                           "sampleNets","IRT5.dne"), session=sess)

irt5.theta <- NetworkFindNode(irt5,"Theta")
irt5.x <- NetworkFindNode(irt5,paste("Item",1:5,sep="_"))

CompileNetwork(irt5) ## Ready to enter findings

stopifnot(NodeFinding(irt5.x[[1]]) == "@NO FINDING")

NodeFinding(irt5.x[[1]]) <- "Right"
stopifnot(NodeFinding(irt5.x[[1]]) == "Right")

RetractNodeFinding(irt5.x[[1]]) 
stopifnot(NodeFinding(irt5.x[[1]]) == "@NO FINDING")

NodeFinding(irt5.x[[1]]) <- "Wrong"
NodeFinding(irt5.x[[2]]) <- 1
NodeFinding(irt5.x[[3]]) <- 2
stopifnot(
  NodeFinding(irt5.x[[1]]) == "Wrong",
  NodeFinding(irt5.x[[2]]) == "Right",
  NodeFinding(irt5.x[[3]]) == "Wrong",
  NodeFinding(irt5.x[[4]]) == "@NO FINDING",
  NodeFinding(irt5.x[[5]]) == "@NO FINDING"
)

RetractNetFindings(irt5)
stopifnot(
  NodeFinding(irt5.x[[1]]) == "@NO FINDING",
  NodeFinding(irt5.x[[2]]) == "@NO FINDING",
  NodeFinding(irt5.x[[3]]) == "@NO FINDING",
  NodeFinding(irt5.x[[4]]) == "@NO FINDING",
  NodeFinding(irt5.x[[5]]) == "@NO FINDING"
)

DeleteNetwork(irt5)
stopSession(sess)


[Package RNetica version 0.8-2 Index]