RetractNodeFinding {RNetica} | R Documentation |
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.
RetractNodeFinding(node) RetractNetFindings(net)
node |
An active |
net |
An active |
This is an undo function for NodeFinding()
,
EnterNegativeFinding()
or
NodeLikelihood()
. In particular, it allows for entering
hypothesized findings for various calculations.
Returns its argument invisibly.
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.
Russell Almond
http://norsys.com/onLineAPIManual/index.html: RetractNetFindings_bn(), RetractNodeFindings_bn()
NeticaBN
, NeticaNode
,
NodeBeliefs()
,
EnterNegativeFinding()
,
EnterGaussianFinding()
, EnterIntervalFinding()
,
NodeFinding()
, NodeLikelihood()
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)