Means and Values of Nodes
Context
At the top of each Monitor, the fields Mean, Dev, and Value can be displayed.
Mean refers to the Mean Value and is only shown in the Monitors of numerical nodes.
Dev displays the standard deviation alongside Mean.
Value displays the expected value and is available for both categorical and numerical nodes.
Examples
The calculations for Expected Value and Mean Value are shown in the context of the following examples:
Categorical node
In this example, is a discrete node with three categorical states.
Categorical node with assigned state values
In the Node Editor, you can assign State Values to the states of .

For each node, the Expected Value is computed using the assigned State Values and the marginal probability distribution of the Node States:
where is the marginal probability of state and is its associated value.
The Monitor shows as the Value of .
A Monitor of a categorical node does not show a Mean value.
Discrete numerical variable
Let’s suppose that the node has three numerical Node States instead of categorical Node States.

In this context, we need to consider two conditions, with and without State Values specified in the Node Editor:
No state values specified
Here, State Values are not specified in the Values tab of the Node Editor. Note the empty Value column below.

As a result, BayesiaLab uses the numerical values of the Node States, as they appear in the States tab, as the State Values.
Furthermore, as is a numerical node, its Monitor will now display the Mean and Dev in addition to Value.
The mean is computed using the numerical values of the Node States and the marginal probability distribution of the Node States:
where is the numerical value of the Node State.
Note that Mean and Value are identical in this case.
State values specified
However, if State Values are separately specified in the Values tab of the Node Editor, they will be used for the calculation of Value in the Monitor.
To illustrate the distinction, we assign the states , , and the values 0, 1, and 2, respectively.

The Expected Value is computed now using the assigned State Values 0, 1, and 2 and the marginal probability distribution of the Node States:
where is the marginal probability of state and is its associated value.
The Monitor shows as the Value of .
Note that Mean and Value are not identical in this case.
Mean weights the ages 10, 40, and 70 by their probabilities. Value applies the same weights to the assigned scores 0, 1, and 2.
Continuous numerical variable
In the next example, is a continuous node with domain and three discretized states.
- :
- :
- :

Given that is a numerical node, its Monitor shows the fields Mean, Dev, and Value.
No associated data
When no data is associated with the node, both and use the midpoint of each state’s interval. For , the midpoint of is . At probability , this state contributes to each weighted sum below.
So, the Mean Value is computed as follows:
The Expected Value is calculated analogously:
With no associated data or custom state values, BayesiaLab uses each interval midpoint for both Mean and Value. The dots mark the ages used in the weighted sum.
Associated data
If data is associated with the node, is defined as the arithmetic mean of the data points that are associated with each Node State.
Furthermore, clicking on the Generate Values button in the Node Editor sets the values to the current arithmetic means of each Node State.

Value delta
If you set a new piece of evidence on a node that modifies the distribution of the node, the Monitor displays a delta value in parentheses adjacent to Value.
This delta is the difference between the current Expected Value and:
- the Expected Value before setting the modifying evidence, or
- the Expected Value that corresponds to the Reference Probability Distribution, which you can set with the icon in the toolbar.
Special case: some node states without values
If only some Node States have an associated value, the Expected Value is computed from the subset of Node States that do have an associated value.
Here, is the total probability of the states with assigned values.
Suppose only Adult and Senior have assigned values, 40 and 70. Together they carry 77% of the probability. Dividing each probability by 0.77 gives the weights used to calculate Value.
If a node only has a single Node State with an associated value, the corresponding Monitor does not report the Expected Value .