MakeCliqueNode {RNetica}R Documentation

Forces a collection of nodes in a Netica network to be in the same clique.

Description

When a junction tree is compiled, if the nodes are in the same clique, it is easier to calculate their joint probability. The function MakeCliqueNode(nodelist) forces the nodes in nodelist by making a special one state clique node with all of the nodes in nodelist as a parent.

Usage

MakeCliqueNode(nodelist)
is.CliqueNode(x)
GetClique(cliquenode)

Arguments

nodelist

A list of active NeticaNode objects from the same network.

x

An object to be tested to see if it is a clique node.

cliquenode

A CliqueNode to be queried.

Details

It is substantially easier to calculate the joint probability of a number of nodes if they are all in the same clique (see JointProbability(nodelist). If it is known that such a query will be common, the analyst can take steps to force the nodes into the same clique if required. The Student Model/Evidence Model algorithm of Almond and Mislevy (1999) also requires that the student model variables that are referenced in an evidence model all be in the same clique (although this algorithm is not currently supported by Netica).

A node and its parents is always a clique or a subset of a clique in the junction tree (see CompileNetwork() or JunctionTreeReport()). This function forces nodes into the same clique by creating a new CliqueNode and making all of the nodes in nodelist parents of the new node.

The CliqueNode is a subclass of NeticaNode. It has a number of special features. It's name is always “Clique” followed by a number. It only has one state, and it has a special "clique" field which records the nodelist used to create it. The function is.CliqueNode() tests a node to see if it is a clique node, and the function GetClique(node) retrieves the nodelist. (This should not be set manually).

The CliqueNode objects should, for the most part, behave like regular nodes. However, it is almost certainly a mistake to try and set findings on a CliqueNode.

Value

The function MakeCliqueNode(nodelist) returns a new CliqueNode object whose parents are the variables in nodelist. This behaves in most respects like an ordinary node, but it would almost certainly be a mistake to try and enter findings for this node. In particular, deleting the clique node will no longer constrain its parents to be in the same clique (although other connections in the network may cause the nodes to be placed in the same clique).

The function is.CliqueNode(x) returns a logical value which is true if x is a clique node.

The function GetClique(node) returns the nodelist used to create the clique node.

Note

Clique nodes only last for the R session that was used to create them. After that, they will appear like ordinary nodes. They will still be present in the network, but the special "clique" attribute will be lost.

Currently Netica only allows virtual evidence at the node level (NodeLikelihood()). I'm lobbying to get Netica to support it at the clique level as well. At which point, this function becomes extremely useful.

Author(s)

Russell Almond

References

Almond, R. G. & Mislevy, R. J. (1999) Graphical models and computerized adaptive testing. Applied Psychological Measurement, 23, 223-238.

Almond, R., Herskovits, E., Mislevy, R. J., & Steinberg, L. S. (1999). Transfer of information between system and evidence models. In Artificial Intelligence and Statistics 99, Proceedings (pp. 181–186). Morgan-Kaufmann

http://norsys.com/onLineAPIManual/index.html: See the NeticaEx function FormCliqueWith is the documentation for JointProbability_bn()

See Also

CliqueNode, NeticaNode, JointProbability(), AddLink(), JunctionTreeReport()

Examples

sess <- NeticaSession()
startSession(sess)

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

CompileNetwork(EMSMSystem)
## Note that Skill1 and Skill2 are in different cliques
JunctionTreeReport(EMSMSystem)

Skills12 <- NetworkFindNode(EMSMSystem,c("Skill1","Skill2"))
cn <- MakeCliqueNode(Skills12)
cnclique <- GetClique(cn)

stopifnot(
  is.CliqueNode(cn),
  setequal(sapply(cnclique,NodeName),sapply(Skills12,NodeName))
)

CompileNetwork(EMSMSystem)
## Note that Skill1 and Skill2 are in different cliques
JunctionTreeReport(EMSMSystem)

DeleteNodes(cn) ## This clears the clique.

DeleteNetwork(EMSMSystem)
stopSession(sess)


[Package RNetica version 0.8-4 Index]