贝叶斯网络CPT构建疑问:报警盗窃示例中概率值来源及计算规则
Let's unpack your questions one by one—this is a common point of confusion when first learning Bayesian networks, so you're not alone!
1. Where do values like P(A|B,E) come from?
In the classic burglary alarm example, values in the Conditional Probability Table (CPT) for node A (Alarm) typically come from domain expert knowledge or historical data. For example:
- An expert might say, "If there's a burglary (
B=true) AND an earthquake (E=true), the alarm will almost definitely ring—let's assignP(A|B,E) = 0.95" - The complementary probability
P(¬A|B,E)is then calculated automatically as1 - 0.95 = 0.05to ensure the probabilities for each row (each parent combination) sum to 1.
This logic applies to all CPT rows: you specify most values based on expertise or data, and the final value in each row is derived to maintain the table's validity.
2. How many CPT values can you choose freely, and how many must be calculated?
The number of free parameters in a CPT depends on two factors:
- Parent node combinations: For node
A, parentsBandEare both binary (true/false), so there are2*2 = 4unique parent state combinations. - Child node states:
Ais binary, so each parent combination requires a probability distribution where the sum of probabilities equals 1.
For a binary child node, each parent row has 1 free parameter (you pick one probability, the other is 1 - chosen_value). So for A's CPT, you can freely define 4 values (one per parent row), and the other 4 are computed automatically.
In general: If a child node has k states, and there are S unique parent combinations, you have S*(k-1) free parameters to specify; the remaining S values are calculated to satisfy the sum-to-1 rule for each row.
3. What about P(J|M)—is it chosen or calculated?
First, a key clarification: P(J|M) is not part of any CPT in the standard burglary alarm network. In that model, J (John calls) and M (Mary calls) both have A (Alarm) as their only parent. Their CPTs are defined directly via expert knowledge:
P(J|A)andP(J|¬A)P(M|A)andP(M|¬A)
P(J|M) is a posterior probability—it’s something you compute using Bayesian inference, combining the CPT values, prior probabilities (P(B), P(E)), and evidence (in this case, M=true). You can’t just "choose" this value; it’s derived entirely from the network’s structure and the parameters you’ve already defined in the CPTs and priors.
内容的提问来源于stack exchange,提问作者Einar Johnsen

