# Contents

# Question

How does BayesiaLab calculate the Means and Values in the **Monitors**? What is the difference?

# Answer

For each node that has values associated with its states, an *Expected Value* is computed by using the associated values and the marginal probability distribution of the node.

where is the marginal probability of state and is its associated value.

This *Expected Value* is displayed in the monitor.

**Example**

Let's take a discrete node *Age* with three categorical states:

- Young Adult
- Adult
- Senior

The **Node Editor** allows associating numerical values with these states.

Let's suppose now that the variable *Age* has three numerical states.

As it's a numerical node, its monitor will have a *Mean* value, a *Standard Deviation* and an *Expected Value*.

When the states do not have any associated values, is automatically set to the numerical value of the state.

Otherwise, the state values defined by the user are used:

The Mean value *m* is computed with the following equation:

where is the numerical value of the state.

Let's consider now a continuous variable *Age* defined on the domain [15 ; 99], and discretized into three states:

- Young Adult: [15 ; 30]
- Adult: ]30 ; 60]
- Senior: ]60 ; 99]

Again, as it's a numerical node, its monitor will have a *Mean* value, a* Standard Deviation* and an *Expected Value*.

The Mean value *m* is computed with the following equation:

where is the central tendency of the state defined as:

- the mid-range of the state when no data is associated,
- the arithmetic mean of the data points that are associated with the state.

When the states do not have any associated values, is automatically set to the central tendency of the state.

When new pieces of evidence are set, a the delta value is displayed in the monitor:

This delta is the difference between the current *Expected Value* and:

- the previous one,
- the one corresponding to the reference probability distribution set with in the toolbar.

When only some states have an associated value, the *Expected Value* is computed on the states that have associated values

where

When is only made of one state, the node is considered as not having any associated values.