DE424 Practical 5 - Report

Name & Surname: Robert Jaret Thompson Student Number: 24704806 Date: 13 March 2025

Plagiarism Declaration

This submission is entirely my own work, excepting the inclusion of resources explicitly permitted for this assignment, and assistance as noted in the following two items.

  • DE424 Practical 3 outline
  • Emdw userguide
  • Emdw devguide

I have not and will not facilitate plagiarism, such as by distributing any written work or source code created by fellow students. I understand that any code I submit may be inspected for plagiarism detection (either manually or by automated systems).

Signed:


Introduction

In this practical, the belief propagation and belief update algorithms are manually implemented for the Hamming (7,4) error-correction code using a junction tree. The junction tree structure is derived from the variable elimination (VE) order: .

Figure 1: Markov Network (MN)

In an MN, the joint distribution is represented as a product of factors over maximal cliques:

where and

The goals:

  • Question 4.2: a) Manually implement the belief-update/absorption/Lauritzen-Spiegelhalter algorithm on the Junction Tree and b) a valid message-passing schedule to extract the marginal beliefs.
  • Question 4.3: a) Manually implement the belief-update/absorption/Lauritzen-Spiegelhalter algorithm on the Loopy Cluster Graph and b) after message-passing, extract the marginal beliefs and compare.
  • Question 4.4: Use emdw’s built-in loopy belief update function loopyBU CG

The Lauritzen-Spiegelhalter algorithm is a fundamental approach for performing exact inference in probabilistic graphical models, particularly in a junction tree. Unlike belief propagation, which relies on message passing, this approach leverages the concept of belief update and absorption through sepsets and cluster potentials.

4.2 Belief-update/absorption/Lauritzen-Spiegelhalter Algorithm in a Junction Tree

Using the given VE order, the junction tree is constructed as shown in Figure 2.

Figure 2: Junction Tree

Cliques: , , ,

Sepsets: , ,

The belief update process involves two main passes: the inward pass and the outward pass, where factors are marginalized over the sepsets and absorbed back into the cliques. The goal is to ensure consistency between the cluster beliefs and the sepset beliefs.

Inward Pass

In the inward pass, the algorithm marginalizes each factor over the sepsets and updates the clique potential by absorbing the information from neighboring cliques.

Initialize: , , , ,

“Message” from 1 2: & &

“Message” from 1 3: & &

“Message” from 1 4: & &

Outwards Pass

Initialize: & &

“Message” from 2 1: & &

“Message” from 3 1: & &

“Message” from 4 1: & &

Figure 3: Belief-update algorithm for Junction Tree with emdw

Figure 4: Extracting marginal beliefs

Figure 5: Marginal belief of and

13.47419e-100
0.9999831.69858e-050
0.998630.001369681
0.001369680.998631
The Belief-update/absorption/Lauritzen-Spiegelhalter algorithm successfully propagates the beliefs in a junction tree. This method leverages the tree structure to efficiently compute the marginal probabilities, however it did not seem to return the desired results when compared to Question 4.1. which returned results that was more expected.

Figure 6: Results from Question 4.1

4.3 Belief-update/absorption/Lauritzen-Spiegelhalter Algorithm in a Loopy Cluster Graph

Figure 6: Loopy Cluster Graph

Cliques: , ,

Sepsets: , ,

Forwards

Initialize: & & , ,

“Message” from 2 3: & &

“Message” from 3 4: & &

“Message” from 4 2: & &

Backwards

”Message” from 2 4: & &

“Message” from 4 3: & &

“Message” from 3 2: & &

For a Loopy Cluster Graph, this algorithm needs to be repeated until sufficiently small distance is obtained between current and new sepset beliefs.

Figure 7: Belief-update algorithm for Loopy Cluster Graph

**Figure 8: Marginal belief of and

1.25148e-1611
0.4909340.5090661
0.009375240.9906251
0.9906250.009375240
The updated beliefs closely matched those obtained from the junction tree belief propagation in Question 4.1 but not to the belief update in Question 4.2. The convergence was slower due to the loopy structure but provided consistent results.

In Loopy Belief Propagation (LBP), messages are passed iteratively between clusters until convergence. However, this approach can be inefficient in graphs with many loops due to redundant message passing and lack of guaranteed convergence.

In Belief Update (Lauritzen-Spiegelhalter absorption algorithm), we leverage the junction tree, which is a tree-structured representation of the original graph. This allows us to pass messages exactly once along a valid schedule (inward and outward passes). Since the junction tree structure eliminates loops, message passing becomes exact and efficient.

4.4 Loopy Belief-update using emdw built-in functionality

Results from built-in emdw Belief-update loopyBU CG function:

for the bits: , , , , , , ,

This result closely matches the results achieved in Question 4.1 and Question 4.3.