当前位置:网站首页>贝叶斯定律
贝叶斯定律
2022-07-07 04:45:00 【Steven迪文】
1.概率理论
先复习一些概率理论。
联合概率:事件 A 和事件 B 同时发生的概率;也叫做乘积法则。
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)
求和规则:事件 A 和 事件 B不同时发生的概率。
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)
如果 A 和 B 是互相排斥的:
P ( A ∪ B ) = P ( A ) + P ( B ) P(A \cup B) = P(A) + P(B) P(A∪B)=P(A)+P(B)
全概率:假如事件 A 的发生可能由多种可能的 事件B 导致。
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)
条件概率:给定事件 B 事件 A 发生的概率。
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. 贝叶斯定律
在机器学习中,给定观测的训练数据 B,我们经常感兴趣于求最佳假设空间 A。
最佳的假设空间就是最可能的假设空间,也就是给定训练数据 B,把各种训练数据 B 在假设空间 A 中的先验概率相加。
根据以上定义,求假设空间 A 的概率如下:
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)
是不是很熟悉?
这其实就是全概率公式,事件 A 的发生可能由数据 B 1 B_1 B1, B 2 B_2 B2… … B n B_n Bn
多种原因导致。
对于给定训练数据 B, 求假设空间 A 的概率,贝叶斯定理提供了一个更直接的方法。
贝叶斯定律使用:
- 假设空间 A 的先验概率 P ( A ) P(A) P(A)
- 以及观测数据的先验概率概率 P ( B ) P(B) P(B)
- 给定假设空间 A,观测数据 B 的概率 P ( B ∣ A ) P(B|A) P(B∣A)
求给定观测数据 B,求假设空间 A 的概率 P ( A ∣ B ) P(A|B) P(A∣B),也称作后验概率,因为它反映了给定数据 B,对假设空间 A 概率的影响。
与先验概率相反, P(A) 与 B 是独立的。
贝叶斯公式:
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)
贝叶斯公式的推导也很简单,结合第一部分我们提到的条件概率和联合概率便可求出。
条件概率:
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)
联合概率:
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. 最大后验概率 MAP
有时,给定数据B,想要求假设空间 A 中的最可能的假设称为最大后验概率 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)
也就是求:
= 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)
去掉 P ( B ) P(B) P(B)是因为其与假设 A 是独立的。
= a r g m a x P ( B ∣ A ) P ( A ) = argmax P(B|A)P(A) =argmaxP(B∣A)P(A)
边栏推荐
- Button wizard script learning - about tmall grabbing red envelopes
- 快速使用 Jacoco 代码覆盖率统计
- 3D reconstruction - stereo correction
- Chip information website Yite Chuangxin
- Explore Cassandra's decentralized distributed architecture
- Qt学习28 主窗口中的工具栏
- [matlab] when matrix multiplication in Simulink user-defined function does not work properly, matrix multiplication module in module library can be used instead
- C language flight booking system
- Custom class loader loads network class
- [webrtc] M98 screen and window acquisition
猜你喜欢

Leetcode 40: combined sum II
![[matlab] when matrix multiplication in Simulink user-defined function does not work properly, matrix multiplication module in module library can be used instead](/img/e3/cceede6babae3c8a24336c81d98aa7.jpg)
[matlab] when matrix multiplication in Simulink user-defined function does not work properly, matrix multiplication module in module library can be used instead

2022茶艺师(初级)考试题模拟考试题库及在线模拟考试
![[webrtc] m98 Screen and Window Collection](/img/b1/1ca13b6d3fdbf18ff5205ed5584eef.png)
[webrtc] m98 Screen and Window Collection

解决问题:Unable to connect to Redis

Custom class loader loads network class

Implementation of replacement function of shell script

Linux server development, MySQL index principle and optimization

Li Kou interview question 04.01 Path between nodes

自定义类加载器加载网络Class
随机推荐
Common validation comments
Figure out the working principle of gpt3
The charm of SQL optimization! From 30248s to 0.001s
[Stanford Jiwang cs144 project] lab3: tcpsender
[P2P] local packet capturing
Open source ecosystem | create a vibrant open source community and jointly build a new open source ecosystem!
Linux server development, MySQL process control statement
@component(““)
pytest+allure+jenkins环境--填坑完毕
Hands on deep learning (IV) -- convolutional neural network CNN
Es FAQ summary
paddlepaddle 29 无模型定义代码下动态修改网络结构(relu变prelu,conv2d变conv3d,2d语义分割模型改为3d语义分割模型)
[unity] several ideas about circular motion of objects
Button wizard collection learning - mineral medicine collection and running map
[quick start of Digital IC Verification] 15. Basic syntax of SystemVerilog learning 2 (operators, type conversion, loops, task/function... Including practical exercises)
[SUCTF 2019]Game
芯片资料 网站 易特创芯
【数字IC验证快速入门】15、SystemVerilog学习之基本语法2(操作符、类型转换、循环、Task/Function...内含实践练习)
[advanced digital IC Verification] command query method and common command interpretation of VCs tool
[VHDL parallel statement execution]