Understanding Bayes Net Inference Algorithm from Russel & Norvig

  • Thread starter Thread starter 0rthodontist
  • Start date Start date
  • Tags Tags
    Net
Click For Summary
SUMMARY

The discussion focuses on the Bayes Net Inference Algorithm as presented in "Artificial Intelligence: A Modern Approach" by Russell & Norvig. The key function, Enumeration-Ask, computes the distribution of a query variable X given observed values e within a Bayes net. The user expresses confusion regarding the Enumerate-All function, particularly in calculating P(y | parents(Y)) when the values of the parent nodes are unknown. The algorithm relies on the conditional probability distribution defined in the Bayes net to resolve this uncertainty.

PREREQUISITES
  • Understanding of Bayes Nets and their structure
  • Familiarity with conditional probability
  • Knowledge of the Enumeration-Ask function and its parameters
  • Basic programming skills to interpret algorithmic functions
NEXT STEPS
  • Study the implementation of Bayes Net algorithms in Python using libraries like pgmpy
  • Learn about conditional probability tables (CPTs) in Bayes Nets
  • Explore the concept of marginalization in probabilistic inference
  • Investigate alternative inference algorithms such as Variable Elimination
USEFUL FOR

This discussion is beneficial for students of artificial intelligence, data scientists working with probabilistic models, and software developers implementing Bayesian inference algorithms.

0rthodontist
Science Advisor
Messages
1,229
Reaction score
0
I don't understand this simple algorithm from Russel & Norvig for computing a distribution of X given certain observed values e:

Code:
function Enumeration-Ask(X, e, bn) returns a distribution over X
	inputs: X, the query variable
		e, observed values for variables E
		bn, a Bayes net with variables {X} u E u Y /* Y = hidden variables */
	
	Q(X) <- a distribution over X, initially empty
	for each value xi of X do
		extend e with value xi for X
		Q(xi) <- Enumerate-All(Vars[bn], e)
	return Normalize(Q(X))
	
function Enumerate-All(vars, e) returns a real number
	if Empty?(vars) then return 1.0
	Y <- First(vars)
	if Y has value y in e
		then return P(y | parents(Y)) * Enumerate-All(Rest(vars), e)
		else return the sum over y of P(y | parents(Y)) * Enumerate-All(Rest(vars), ey)
			where ey is e extended with Y = y

I am having trouble understanding exactly what Enumerate-All does. Specifically I do not understand how P(y | parents(Y)) is computed. We don't know the values that the parents of Y take, do we?
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
4
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K