Example 1: Parameter Updating for one node
We start with a single node representing , which has a uniform distribution, i.e., a 50/50 mix of and . For a compact presentation, we show the node here in Monitor Style, which means that, in Validation Mode, the distribution of the states is directly shown on the node.
Before starting Parameter Updating, we specify the Prior Weight and Discount via the Node Editor. Open Node Contextual Menu > Edit, choose Probability Distribution, then select Updating. Here, we set Prior Weight to 100. This means that we consider our prior equivalent to a population of 100 individuals, 50 male and 50 female. We leave Discount at its default value of 1. With this setting, we stipulate that no existing particles will be forgotten as additional new particles are added to the mix.
With node information visible, shows icons for Prior Weight and Discount in its upper-right corner.
You can start Parameter Updating in Validation Mode by selecting Menus > Inference > Parameter Updating. Then, a window prompts you to confirm the use of the currently specified Prior Weight or to select an alternative Prior Weight.
If a dataset is associated with the given network, BayesiaLab will prompt you for additional settings. You can specify, for instance, that the Prior Weights be computed from the associated dataset.
Additionally, you can choose the Evidence Source, which determines where to obtain the particles for Parameter Updating:
- Manual Evidence means that new particles are coming from the evidence you set on the Monitors.
- Data Set means that the observations stored in the associated dataset are retrieved to be used as particles.
For the one-node example, select Manual Evidence and Use Current Prior Weights. Keep the discount at 1.
Upon clicking OK, a new control panel appears on the Toolbar.
- Learn Evidence takes the evidence entered via the Monitors and updates the probability tables accordingly.
- Reset removes all added particles and reverses any updates performed thus far.
- Clicking the blue arrow button activates the inclusion of Not-Observable Nodes from an associated dataset or an Evidence Scenario File. By default, observations of Not-Observable Nodes are excluded from updating probabilities in the context of Parameter Updating.
- Validate Updating opens a confirmation. Choosing Yes keeps the updated probabilities and closes Parameter Updating.
- Stop Updating exits Parameter Updating without validating the updated probabilities. As a result, all updates are lost.
- The counter shows how many particles have been added so far to update the probability tables.
Adding particles
We now take this network consisting of the single node and perform Parameter Updating by adding particles one-by-one. Before any evidence is set, the Information Panel shows a joint probability of 100%.
Particle #1
For the first particle, we set the evidence that is . The Information Panel shows that the Joint Probability that is is 50%, which is what we expect given the Probability Table we specified.
Upon clicking Learn Evidence, this new particle is mixed with the 100 virtual particles from the prior, and we now have a population of 51 females and 50 males. As a result, the probability table of the node is updated using Maximum Likelihood Estimation based on this new population. The new probability of the state is now 50.5%. While we don’t see the probability table of the node , the Information Panel reports a Joint Probability of .
Note that after adding the particle, the evidence remains set on .
Particle #2
Upon clicking Learn Evidence, this evidence, i.e., is , is added as a new particle and mixed with the 101 virtual particles, and we now have a population of 52 females and 50 males. The new probability of the state is now 50.98% and the Information Panel reports a Joint Probability of .
Note that after adding the particle, the evidence remains set on .
Particle #3
Now for the third particle, we set the evidence that is .
Upon clicking Learn Evidence, this evidence, i.e., is , is added as a new particle and mixed with the 102 virtual particles, and we now have a population of 52 females and 51 males. The new probability of the state is now 49.51% and the Information Panel reports a Joint Probability of .
With the counter at 3, click Validate Updating, then confirm with Yes.
After validation, clear any remaining observation to see the new marginal probability distribution for , both on the node (in Monitor Style) and in the corresponding Monitor in the Monitor Panel.
Furthermore, we can go into the Node Editor to see its updated status. The Node Editor shows that Prior Weight is now equal to 103:
- 100 from the virtual particles defined via the original Prior Weight.
- 3 from the particles we created by manually setting evidence.
Of course, we can also see the new marginal probability distribution in the Tabular tab.
Discounting
With Discount set to 1, we did not apply any discounting to earlier particles as newer particles came in. Repeating the same three observations with Discount set to 0.75 gives the following results.
Each new particle has weight 1. Before adding it, BayesiaLab multiplies both existing state counts by the discount. For example, the first female observation changes the female count from 50 to . The updated state probability is its weighted count divided by the total weight.
Weighted counts
| Step | Male | Female | Total |
|---|---|---|---|
| 0 | 50 | 50 | 100 |
| 1 | 37.5 | 38.5 | 76 |
| 2 | 28.125 | 29.875 | 58 |
| 3 | 22.09375 | 22.40625 | 44.5 |
Updated probabilities
| Particle | Male | Female |
|---|---|---|
| Initial | 50.00% | 50.00% |
| 1 · Female | 49.34% | 50.66% |
| 2 · Female | 48.49% | 51.51% |
| 3 · Male | 49.65% | 50.35% |