当前位置:网站首页>Bayes' law
Bayes' law
2022-07-07 08:09:00 【Steven Devin】
1. probability theory
First review some probability theory .
joint probability : event A And events B Probability of simultaneous occurrence ; Also called product rule .
P ( A , B ) = P ( A ∩ B ) = P ( A ∣ B ) P ( B ) = P ( B ∣ A ) P ( A ) P(A,B) = P(A \cap B) = P(A|B)P(B) = P(B|A)P(A) P(A,B)=P(A∩B)=P(A∣B)P(B)=P(B∣A)P(A)
Summation rule : event A and event B The probability of different occurrences .
P ( A ∪ B ) = P ( A ) + P ( B ) − P ( A ∩ B ) P(A \cup B) = P(A) + P(B)-P(A\cap B) P(A∪B)=P(A)+P(B)−P(A∩B)
If A and B Are mutually exclusive :
P ( A ∪ B ) = P ( A ) + P ( B ) P(A \cup B) = P(A) + P(B) P(A∪B)=P(A)+P(B)
Total probability : If the event A The occurrence of may be caused by many possible event B Lead to .
P ( A ) = ∑ i n P ( A ∣ B i ) P ( B i ) P(A) = \sum_{i} ^nP(A|B_{i})P(B_{i}) P(A)=i∑nP(A∣Bi)P(Bi)
Conditional probability : Given event B event A Probability of occurrence .
P ( A ∣ B ) = P ( A , B ) P ( B ) P(A|B)=\frac{P(A,B)}{P(B)} P(A∣B)=P(B)P(A,B)
2. Bayes' law
In machine learning , Given the observed training data B, We are often interested in finding the best hypothesis space A.
The best hypothetical space is the most possible hypothetical space , That is, given training data B, Put all kinds of training data B In hypothetical space A Medium Prior probability Add up .
According to the above definition , Finding hypothesis space A The probability is as follows :
P ( A ) = ∑ n P ( A ∣ B i ) P ( B i ) P(A) = \sum_{n} P(A|B_{i})P(B_{i}) P(A)=n∑P(A∣Bi)P(Bi)
Is that familiar ?
This is actually All probability formula , event A The occurrence of may be caused by data B 1 B_1 B1, B 2 B_2 B2… … B n B_n Bn
Many reasons lead to .
For a given training data B, Finding hypothesis space A Probability , Bayesian theorem provides a more direct method .
Bayesian law uses :
- Hypothetical space A Of Prior probability P ( A ) P(A) P(A)
- And observation data Prior probability probability P ( B ) P(B) P(B)
- Given a hypothetical space A, Observation data B Probability P ( B ∣ A ) P(B|A) P(B∣A)
Find the given observation data B, Finding hypothesis space A Probability P ( A ∣ B ) P(A|B) P(A∣B), Also known as Posterior probability , Because it reflects the given data B, For hypothetical space A The influence of probability .
Contrary to a priori probability , P(A) And B It's independent .
Bayes' formula :
P ( A ∣ B ) = P ( B ∣ A ) P ( A ) P ( B ) P(A|B)=\frac{P(B|A)P(A)}{P(B)} P(A∣B)=P(B)P(B∣A)P(A)
The derivation of Bayesian formula is also very simple , Combining the conditional probability and joint probability mentioned in the first part, we can find .
Conditional probability :
P ( A ∣ B ) = P ( A , B ) P ( B ) P(A|B)=\frac{P(A,B)}{P(B)} P(A∣B)=P(B)P(A,B)
joint probability :
P ( A , B ) = P ( B ∣ A ) P ( A ) {P(A,B)} = P(B|A)P(A) P(A,B)=P(B∣A)P(A)
3. Maximum posterior probability MAP
Sometimes , Given data B, Want to ask for hypothetical space A The most likely assumption in is called Maximum posterior probability MAP(Maximum a Posteriori).
A M A P = a r g m a x P ( A ∣ B ) A_{MAP} = argmax P(A|B) AMAP=argmaxP(A∣B)
That is o :
= a r g m a x P ( B ∣ A ) P ( A ) P ( B ) = argmax \frac{P(B|A)P(A)}{P(B)} =argmaxP(B)P(B∣A)P(A)
Get rid of P ( B ) P(B) P(B) Because it is related to the assumption A yes independent .
= a r g m a x P ( B ∣ A ) P ( A ) = argmax P(B|A)P(A) =argmaxP(B∣A)P(A)
边栏推荐
- [quickstart to Digital IC Validation] 15. Basic syntax for SystemVerilog Learning 2 (operator, type conversion, loop, Task / Function... Including practical exercises)
- 王爽 《汇编语言》之寄存器
- Lattice coloring - matrix fast power optimized shape pressure DP
- The zblog plug-in supports the plug-in pushed by Baidu Sogou 360
- 太真实了,原来自己一直没有富裕起来是有原因的
- Avatary的LiveDriver试用体验
- offer收割机:两个长字符串数字相加求和(经典面试算法题)
- game攻防世界逆向
- Qt学习26 布局管理综合实例
- json 数据展平pd.json_normalize
猜你喜欢
LeetCode简单题之判断一个数的数字计数是否等于数位的值
探索干货篇!Apifox 建设思路
【数字IC验证快速入门】14、SystemVerilog学习之基本语法1(数组、队列、结构体、枚举、字符串...内含实践练习)
Jmeter 的使用
【数字IC验证快速入门】15、SystemVerilog学习之基本语法2(操作符、类型转换、循环、Task/Function...内含实践练习)
有 Docker 谁还在自己本地安装 Mysql ?
Complex network modeling (I)
海信电视开启开发者模式
LeetCode简单题之字符串中最大的 3 位相同数字
QT learning 26 integrated example of layout management
随机推荐
力扣(LeetCode)187. 重复的DNA序列(2022.07.06)
Recursive method to construct binary tree from preorder and inorder traversal sequence
Qt学习27 应用程序中的主窗口
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after conne
2022 welder (elementary) judgment questions and online simulation examination
Real time monitoring of dog walking and rope pulling AI recognition helps smart city
Few shot Learning & meta learning: small sample learning principle and Siamese network structure (I)
paddlepaddle 29 无模型定义代码下动态修改网络结构(relu变prelu,conv2d变conv3d,2d语义分割模型改为3d语义分割模型)
Complex network modeling (I)
电池、电机技术受到很大关注,反而电控技术却很少被提及?
Binary tree and heap building in C language
Excel import function of jeesite form page
Dedecms collects content without writing rules
Bugku CTF daily one question chessboard with only black chess
B. Value sequence thinking
Quick analysis of Intranet penetration helps the foreign trade management industry cope with a variety of challenges
互动送书-《Oracle DBA工作笔记》签名版
[matlab] when matrix multiplication in Simulink user-defined function does not work properly, matrix multiplication module in module library can be used instead
Notes on PHP penetration test topics
LeetCode简单题之字符串中最大的 3 位相同数字