Bayesian Networks Overview
- 27Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What are the two main components of a factor graph?
27 questions
- 1
What are the two main components of a factor graph?
Model answer
Variables and factors.
Explanation
Factor graphs consist of a set of variables and a set of factors that depend on subsets of variables, specifying preferences or constraints.
- 2
In a factor graph, how is the weight of a complete assignment computed?
Model answer
The weight is the product of all factors evaluated at that assignment.
Explanation
The global weight is the product of local factors, embodying the principle 'specify locally, optimize globally'.
- 3
Explain the concept 'specify locally, optimize globally' in the context of factor graphs.
Model answer
Local factors define preferences or constraints on small subsets of variables, but the goal is to find a global assignment that maximizes the product (or sum) of all factors.
Explanation
We specify how variables interact locally, yet we care about a globally optimal solution over all variables.
- 4
In the object tracking example, what do transition factors capture?
Model answer
Transition factors capture the intuition that an object's location should be close between successive time steps, discouraging teleportation.
Explanation
These factors encode the dynamics of the object, making nearby positions more likely.
- 5
What is the difference between a marginal distribution and a conditional distribution?
Model answer
A marginal distribution is obtained by summing over variables not of interest; a conditional distribution is obtained by fixing some variables to observed values and normalizing.
Explanation
Marginalization removes variables by summation; conditioning selects rows matching evidence and renormalizes.
- 6
How do you compute a conditional distribution from a joint distribution?
Model answer
Select all rows matching the evidence, sum their probabilities, then divide each selected row's probability by that sum (normalization).
Explanation
This yields a probability distribution over the query variables given the evidence.
- 7
What does the notation P(S,R) represent versus P(S=s,R=r)?
Model answer
P(S,R) denotes the entire joint distribution (a table), while P(S=s,R=r) is a single number: the probability of that specific assignment.
Explanation
Uppercase variables without values denote distributions; lowercase values denote specific assignments.
- 8
What is marginalization?
Model answer
Marginalization is summing over all values of a variable to obtain a distribution over the remaining variables.
Explanation
For example, P(S)=∑rP(S=s,R=r) is the marginal distribution of S.
- 9
What is a probabilistic inference query in general form?
Model answer
Probability of query variables conditioned on evidence variables set to specific values: P(query∣evidence).
Explanation
This combines conditioning on evidence and marginalizing out other variables.
- 10
What are the two main challenges when working with joint distributions directly?
Model answer
Representational challenge: the table size is exponential in the number of variables. Algorithmic challenge: inference is expensive.
Explanation
With n binary variables, the table has 2n rows, making representation and inference infeasible for large n.
- 11
How does a Bayesian network address the representational challenge of joint distributions?
Model answer
It defines the joint distribution compactly as the product of local conditional distributions, each involving only a few variables.
Explanation
Each node's conditional distribution is small, and the product yields the full joint distribution implicitly.
- 12
What are the four steps to build a Bayesian network?
Model answer
- Define the variables. 2. Draw directed edges (acyclic) representing influence. 3. Define local conditional distributions. 4. Define the joint distribution as the product of all local conditionals.
Explanation
Steps 1-3 specify the network structure and parameters; step 4 defines the overall probabilistic model.
- 13
In a Bayesian network, what is a local conditional distribution?
Model answer
It is P(node∣parents), a probability table specifying the node's probabilities given each combination of parent values.
Explanation
Each node has one such distribution; for nodes without parents, it is a marginal distribution (e.g., P(B)).
- 14
What is the 'explaining away' phenomenon in Bayesian networks?
Model answer
When two causes both increase the probability of an effect, conditioning on the effect makes the causes negatively correlated; observing one cause reduces the probability of the other.
Explanation
In the alarm network, hearing an earthquake explains the alarm, so the probability of burglary decreases back to its prior.
- 15
Describe the structure of the alarm Bayesian network.
Model answer
Nodes: Burglary (B), Earthquake (E), Alarm (A). Edges: B→A and E→A. Local conditionals: P(B), P(E), P(A∣B,E).
Explanation
B and E have no parents; A's parents are B and E. This captures that both burglary and earthquake can cause the alarm.
- 16
What is meant by consistency of sub-Bayesian networks?
Model answer
Marginalizing out a leaf node (a node with no children) yields a Bayesian network with that node removed, because the factor corresponding to the leaf sums to 1.
Explanation
This graphical simplification arises from the normalization of local conditional distributions.
- 17
Why is marginalizing out a leaf node easier in a Bayesian network than in a general factor graph?
Model answer
In a Bayesian network, the leaf's factor is a conditional distribution that sums to 1 over the leaf variable, so it can be dropped. In a general factor graph, the factor may not sum to 1 and must be kept.
Explanation
The probabilistic semantics of Bayesian networks guarantee that factors are normalized, enabling such simplifications.
- 18
What does consistency of local conditionals guarantee?
Model answer
The local conditional distribution P(node∣parents) defined in the network is identical to the conditional distribution derived from the full joint distribution.
Explanation
This ensures that the local definition is consistent with the global model, so we can think of the local distributions as the true conditionals.
- 19
What is a probabilistic program?
Model answer
A program with random draws that defines a distribution over possible assignments; each run produces a sample from that distribution.
Explanation
It is an alternative representation of a Bayesian network, often more intuitive and flexible.
- 20
Write a probabilistic program for the alarm network with prior probability ε for both burglary and earthquake.
Model answer
B ~ Bernoulli(ε); E ~ Bernoulli(ε); A = B or E (or a noisy version).
Explanation
The program sets B and E independently, then determines A as a function. This matches the Bayesian network structure.
- 21
Describe the Hidden Markov Model (HMM) as a probabilistic program.
Model answer
For t=1 to T: draw H_t from P(Ht∣Ht−1); draw E_t from P(Et∣Ht).
Explanation
H_t are hidden states, E_t are observations. The program generates a sequence of hidden states and observations.
- 22
What is the general structure of many Bayesian networks in terms of hidden and observed variables?
Model answer
Hidden variables H generate observed variables E: P(H,E)=P(H)P(E∣H).
Explanation
We model how unobserved causes produce observed data, then invert via inference to reason about H given E.
- 23
List the five steps for simplifying probabilistic inference in a Bayesian network as presented in the lecture.
Model answer
- Remove non-ancestors of query and evidence variables. 2. Convert to factor graph. 3. Condition on evidence. 4. Marginalize out disconnected components. 5. Compute the marginalization (sum over remaining variables).
Explanation
These steps exploit the structure of the Bayesian network to simplify the computation.
- 24
In the first step of inference simplification, why can non-ancestors of the query and evidence be removed?
Model answer
Because they are independent of the query given the evidence, and their factors sum to 1 when marginalized out, so they do not affect the conditional distribution.
Explanation
This uses the consistency of sub-Bayesian networks: dropping leaf nodes (non-ancestors) does not change the distribution over the remaining variables.
- 25
How does conditioning on evidence affect the factor graph during inference?
Model answer
The observed variable node is removed, and all factors that included that variable are set to the observed value (partial evaluation).
Explanation
This turns the factor graph into a new one with fewer variables, representing the conditional distribution.
- 26
In the alarm network, compute P(B=1∣A=1) in terms of ε, the prior probability of burglary and earthquake.
Model answer
P(B=1∣A=1)=2−ε1, assuming P(B=1)=P(E=1)=ε and P(A=1∣B,E)=1 if B=1 or E=1, else 0.
Explanation
For ε=0.05, this gives approximately 0.513, demonstrating explaining away.
- 27
In the Markov model example, what did P(X3∣X2=5) simplify to?
Model answer
It simplified to the local conditional P(X3∣X2=5).
Explanation
By removing non-ancestors and using properties of Bayesian networks, the inference reduced to the local conditional.

Ask anything
We've read this whole study set, so questions about it get the best answers.