MostProbableConfig {RNetica}R Documentation

Finds the configuration of the nodes most likely to have lead to observed findings.

Description

Findings a set of values for each of the nodes in nodelist such that the probability of that value set is highest given the state of any findings entered into the network. This is sometimes called the “Most Probable Explanation” for the findings.

Usage

MostProbableConfig(net,nth = 0)

Arguments

net

An active and compiled NeticaBN.

nth

Leave this at its default value of zero, it is for future expansion.

Details

The most probable configuration of the nodes in the Bayesian network is the set of values for each of the nodes in the network which have the highest joint probability. This may or may not be thee same as setting the value of each node to the value that maximizes its NodeBeliefs(). Pearl (1988) describes a special max-propagation algorithm which can calculate the most likely configuration of nodes in a Bayesian network. This function runs that algorithm. The probability that is maximized is the posterior probability given the findings.

Note that this produces a configuration over all of the nodes in the network, not just the nodes in some particular set. The Netica documentation suggests running AbsorbNodes() over the unnecessary nodes first. Another possibility (if the set of interesting nodes is small) is to call JointProbability() on the affected nodes and then find the max of that.

Value

A character vector whose names are the names of the nodes in the network (see NetworkAllNodes(net)) and whose values are the names of the states that maximize the posterior probability given the findings.

Warning

The documentation for the Netica function MostProbableConfig_bn() states that likelihood findings (NodeLikelihood()) are not handled properly in MostProbableConfig(). Seems to indicate that this works properly, but some caution is still advised.

Note

The Bayesian network literature also discusses algorithms for the 2nd, 3rd, 4th, etc. most likely findings. These algorithms are slightly more difficult to implement, but are possible on future plans for the Netica API, as it offers the nth argument to the function MostProbableConfig_bn(). At this point in time, it is an error to set nth to anything but 0.

Author(s)

Russell Almond

References

Pearl, J. (1988) Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann.

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

See Also

NeticaBN, NodeBeliefs(), EnterNegativeFinding(), RetractNodeFinding(), NodeFinding() JointProbability(), FindingsProbability()

Examples

sess <- NeticaSession()
startSession(sess)

EMSMMotif <- ReadNetworks(file.path(library(help="RNetica")$path,
                           "sampleNets","EMSMMotif.dne"), session=sess)

CompileNetwork(EMSMMotif)
obs <- NetworkNodesInSet(EMSMMotif,"Observable")
prof <- NetworkNodesInSet(EMSMMotif,"Proficiency")

NodeFinding(obs$Obs1a1) <- "Right"
NodeFinding(obs$Obs1a2) <- "Wrong"
NodeFinding(obs$Obs1b1) <- "Right"
NodeFinding(obs$Obs1b2) <- "Wrong"

mpe <- MostProbableConfig(EMSMMotif)

## Observed values should be set at their findings level.
stopifnot (
  mpe$Obs1a1 == "Right",
  mpe$Obs1a2 == "Wrong",
  mpe$Obs1b1 == "Right",
  mpe$Obs1b2 == "Wrong"
)

## MPE for just proficiency variables.
mpe[names(prof)]

DeleteNetwork(EMSMMotif)
stopSession(sess)


[Package RNetica version 0.7-2 Index]