BN

Inference

Inference by enumeration

  • Select the entries consisitent with the evidence.
  • Sum out H (Hidden variables) to get joint of Query and evidence
  • Normalize

Variable Elimination

  • Op 1: Join Factors
  • Op 2: Eliminiate (Marginalizing Early)
  • Op 3: Normalize

Sampling

Prior sampling

  • 根据贝叶斯网络的拓扑排序,从根节点开始,按照条件概率分布逐步生成样本。
  • 适用于贝叶斯网络的联合分布抽样,但可能导致低效样本(例如,许多样本不符合证据)。

Rejection sampling

  • 先按照直接采样生成样本,然后拒绝不符合证据变量的样本
  • 适用于查询条件概率 P(X∣E)P(X | E)P(X∣E),

Likelilhood weighting

  • 固定证据变量 E,只对非证据变量进行采样。
  • E 的概率贡献度为 w=P(Eparents(E))w = P(E|parents(E))
  • 每个样本权重是所有概率贡献度乘积

Gibbs sampling

Procedure:Keep track of a full instantiation x 1, x 2, …, xn. Start with an arbitrary instantiation consistent with the evidence. Sample one variable at a time, conditioned on all the rest, but keep evidence fixed. Keep repeating this for a long time.
example: