EXACT INFERENCE IN BAYESIAN NETWORKS

This is an exact inference illustration in Bayesian Networks based on the example given in Figure 14.1, pp511, in [1].

You are now following this Submission

% To help my students (Mathematical Department) make sense of Probabilistic Reasoning in my AI class at Xiangtan University, I thereby write down this code segment, hoping to be helpful.
This is an exact inference illustration in Bayesian Networks based on the example given in Figure 14.1, pp511, in [1].
This problem is structured using a Bayesian Network, where each node represents a variable, and edges represent conditional dependencies. The key variables are:
  1. Burglary (B) → Whether a burglary has occurred.
  2. Earthquake (E) → Whether an earthquake has occurred.
  3. Alarm (A) → The alarm goes off, which could be triggered by either a burglary or an earthquake.
  4. JohnCalls (J) → John calls if he hears the alarm.
  5. MaryCalls (M) → Mary calls if she hears the alarm.
B E
\ /
A
/ \
J M
As mentioned in Chapter 14, the basic task for any probabilistic inference system is to compute the posterior probability distribution for a set of query variables, given some observed event—that is, some assignment of values to a set of evidence variables.
The first edition is finished by Chixin Xiao, on 16 Feb 2025, 02:45 am, in Changsha, China.
Email: chixinxiao@gmail.com
[1] "Artificial Intelligence: A Modern Approach, 3rd US ed." Accessed: Dec. 28, 2023. [Online]. Available: http://aima.cs.berkeley.edu/

Cite As

Chixin Xiao (2026). EXACT INFERENCE IN BAYESIAN NETWORKS (https://www.mathworks.com/matlabcentral/fileexchange/180157-exact-inference-in-bayesian-networks), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.3

Probabilistic Reasoning & Direct Sampling

1.0.2

Increase the Direct Sampling method

1.0.1

Add a logo image

1.0.0