void AbsorbNodes_bn ( nodelist_bn*  nodes )

Absorbs all of nodes from their net. This removes and deletes (frees) the nodes while maintaining the global relationship (i.e., joint distribution) of the remaining nodes. In the probabilistic literature this is often referred to as "summing out" variables (or "maxing out" when they are decision nodes).

In order to maintain the joint distribution, Netica may have to add links. Absorbing a nature node which has no finding will only add links from the parents of the removed node and its children's parents, to the removed node's children. However, if it has a finding, many links between the ancestors of the removed node may be added (possibly resulting in very large CPT tables leading to slow behavior or an out-of-memory condition). Absorbing nodes with likelihood findings or negative findings is the worst. When a decision node is absorbed, links will be added from its parents to its children. No links are added when a utility node is absorbed. Added links never created a directed cycle, when there wasn't one to begin with.

The order of the nodes in nodes doesn't matter. The order in which the absorptions are done will be chosen to minimize intermediate calculations (and if decision nodes are involved, it will be similar to that described in Shachter86).

All of the nodes in nodes must be from the same net.

If it is not possible to absorb all of nodes, as many as possible will be absorbed, and then an error will be generated explaining why the next node couldn't be absorbed. Reasons it may not be possible to continue are: nodes are missing CPTs, presence of disconnected links, more than one link from a node to another, presence of directed cycles, unacceptable structure between decision and utility nodes, or multiple utility nodes.

WARNING: This function will delete (free) the entire nodelist_bn nodes (it's contents would be invalid anyway, since all the nodes in it have been deleted (freed)). You should not call DeleteNodeList_bn on it.

Version:

This function is available in all versions.

See also:

DeleteNode_bn    Removes a node without maintaining joint distribution
LimitMemoryUsage_ns    In case this function is consuming too much memory
NewNodeList2_bn    Make the required list of nodes

Example:

The following function is available in NeticaEx.c:
// Handy function to absorb a single node // void AbsorbNode (node_bn* node){ nodelist_bn* nodes = NewNodeList2_bn (1, GetNodeNet_bn (node)); SetNthNode_bn (nodes, 0, node); AbsorbNodes_bn (nodes); }