.. index:: Output Node

.. _Output_Node:

Output Node
===========

In order for an instance, I, of a network, C,  to be applied in another network, N, (via an :ref:`instance node<instance_node>` in N representing I), a mechanism is required for connecting I (or rather nodes of I) to other nodes of N.  As we wish to enforce modularity and information hiding, we cannot allow all nodes of I to have children outside I, as that would violate the information hiding constraint.  Therefore, we need the concept of *output nodes*.  An output node of I (declared as such in the network class C) is visible outside I, and can thus be used as a parent node of nodes outside I.  Note that an output node cannot be a child of nodes outside I, as this would violate the modularity constraint (the domain of a CPT could then contain nodes from several networks).

The network in Figure 1 contains an instance of a network class, Person, describing the relationships between some indicator parameters (say income, education, etc.) and how these affect the probability distribution over political sympathy, say Republican or Democrat, for a person.  Given the bindings of the indicator variables Income and Education (see the description of :ref:`input nodes<input_node>` for details) to "Income 1" and "Edu. 1", we are interested in the resulting probability distribution for Person_1's political sympathy.  Therefore, the variable Vote must be visible outside instances of the network class Person.  Thus, the variable Vote is made an output node of Person.

.. figure:: images/outputnode.png

	Figure 1: The variables "Income 1" and "Edu. 1" are bound to input variables Income and Education of the instance node Person_1.

In our network, we have used the output variable Vote as a parent variable of the nodes C1 and C2.

In the :ref:`tutorial on object-oriented networks<How_To_Build_An_Object_Oriented_Bayesian_Network>`, an example shows how to use input and output nodes.

See also the description of :ref:`input nodes<input_node>`.  Input nodes and output nodes are collectively referred to as *interface nodes*.