推导:参考https://www.cnblogs.com/ycwang16/p/5995702.html
用到的重要公式:
- 全概率公式:
离散:
p ( x ) = ∑ y p ( x , y ) = ∑ y p ( x ∣ y ) p ( y ) p(x) = \sum\limits_y {p(x,y)}=\sum\limits_y {p(x|y)p(y)} p(x)=y∑p(x,y)=y∑p(x∣y)p(y)
连续:
p ( x ) = ∫ p ( x , y ) d y = ∫ p ( x ∣ y ) p ( y ) d y p(x) = \int {p(x,y)\;dy} = \int {p(x|y)p(y)\;dy} p(x)=∫p(x,y)dy=∫p(x∣y)p(y)dy - 条件概率公式:
p ( x , y ) = p ( x ∣ y ) p ( y ) = p ( y ∣ x ) p ( x ) p(x,y)=p(x|y)p(y)=p(y|x)p(x) p(x,y)=p(x∣y)p(y)=p(y∣x)p(x)
Note:与全概率公式很像,注意区分。 - 贝叶斯公式:
基于全概率公式和条件概率公式可得
P ( x , y ) = P ( x ∣ y ) P ( y ) = P ( y ∣ x ) P ( x ) ⇒ P ( x ∣ y ) = P ( y ∣ x ) P ( x ) P ( y ) = causal knowledge ⋅ prior knowledge prior knowledge \begin{array}{c} P(x,y) = P(x|y)P(y) = P(y|x)P(x)\\ \Rightarrow \\ P(x\,\left| {\,y} \right.) = \frac{{P(y|x)\,\,P(x)}}{{P(y)}} = \frac{{{\textrm{causal knowledge}} \cdot {\textrm{prior knowledge}}}}{{{\textrm{prior knowledge}}}} \end{array} P(x,y)=P(x∣y)P(y)=P(y∣x)P(x)⇒P(x∣y)=P(y)P(y∣x)P(x)=prior knowledgecausal knowledge⋅prior knowledge - 融合多传感的贝叶斯公式:
P ( x ∣ y , z ) = P ( x , y , z ) P ( y , z ) = P ( y ∣ x , z ) p ( x , z ) P ( y , z ) = P ( y ∣ x , z ) p ( x ∣ z ) p ( z ) P ( y ∣ z ) p ( z ) = P ( y ∣ x , z ) p ( x ∣ z ) P ( y ∣ z ) \begin{array}{l} P(x|y,z){\rm{ = }}\frac{{P(x,y,z)}}{{P(y,z)}}\\ = \frac{{P(y|x,z)p(x,z)}}{{P(y,z)}}\\ = \frac{{P(y|x,z)p(x|z)p(z)}}{{P(y|z)p(z)}}\\ = \frac{{P(y|x,z)p(x|z)}}{{P(y|z)}} \end{array} P(x∣y,z)=P(y,z)P(x,y,z)=P(y,z)P(y∣x,z)p(x,z)=P(y∣z)p(z)P(y∣x,z)p(x∣z)p(z)=P(y∣z)P(y∣x,z)p(x∣z)
所以:
P ( x ∣ y , z ) = P ( y ∣ x , z ) P ( x ∣ z ) P ( y ∣ z ) P(x|y,z) = \frac{{P(y|x,z)\,\,P(x|z)}}{{P(y|z)}} P(x∣y,z)=P(y∣z)P(y∣x,z)P(x∣z)
例子:
- Bayes Filter例子:
https://www.cnblogs.com/gary-guo/p/5130795.html - 一些名词:
http://noahsnail.com/2018/05/17/2018-05-17-%E8%B4%9D%E5%8F%B6%E6%96%AF%E4%BC%B0%E8%AE%A1%E3%80%81%E6%9C%80%E5%A4%A7%E4%BC%BC%E7%84%B6%E4%BC%B0%E8%AE%A1%E3%80%81%E6%9C%80%E5%A4%A7%E5%90%8E%E9%AA%8C%E6%A6%82%E7%8E%87%E4%BC%B0%E8%AE%A1/