当前位置:网站首页>贝叶斯定律
贝叶斯定律
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)
边栏推荐
- Linux server development, detailed explanation of redis related commands and their principles
- Cnopendata geographical distribution data of religious places in China
- leanote私有云笔记搭建
- Qt学习28 主窗口中的工具栏
- Introduction to basic components of wechat applet
- Regular e-commerce problems part1
- The charm of SQL optimization! From 30248s to 0.001s
- Téléchargement des données de conception des puces
- Problem solving: unable to connect to redis
- Hands on deep learning (IV) -- convolutional neural network CNN
猜你喜欢

Content of string

Linux server development, MySQL index principle and optimization

padavan手动安装php
![[Matlab] Simulink 自定义函数中的矩阵乘法工作不正常时可以使用模块库中的矩阵乘法模块代替](/img/e3/cceede6babae3c8a24336c81d98aa7.jpg)
[Matlab] Simulink 自定义函数中的矩阵乘法工作不正常时可以使用模块库中的矩阵乘法模块代替
![[quickstart to Digital IC Validation] 15. Basic syntax for SystemVerilog Learning 2 (operator, type conversion, loop, Task / Function... Including practical exercises)](/img/e1/9a047ef13299b94b5314ee6865ba26.png)
[quickstart to Digital IC Validation] 15. Basic syntax for SystemVerilog Learning 2 (operator, type conversion, loop, Task / Function... Including practical exercises)

Yugu p1020 missile interception (binary search)

解决问题:Unable to connect to Redis

nacos

LeetCode 90:子集 II

Force buckle 145 Binary Tree Postorder Traversal
随机推荐
2022 National latest fire-fighting facility operator (primary fire-fighting facility operator) simulation questions and answers
Linux server development, MySQL index principle and optimization
Button wizard collection learning - mineral medicine collection and running map
nacos
Operation suggestions for today's spot Silver
buuctf misc USB
Yugu p1020 missile interception (binary search)
[2022 actf] Web Topic recurrence
Rust Versus Go(哪种是我的首选语言?)
Leetcode 43 String multiplication (2022.02.12)
Visualization Document Feb 12 16:42
2022 recurrent training question bank and answers of refrigeration and air conditioning equipment operation
[UVM basics] summary of important knowledge points of "UVM practice" (continuous update...)
Sign up now | oar hacker marathon phase III, waiting for your challenge
探索干货篇!Apifox 建设思路
The principle and implementation of buffer playback of large video files
图解GPT3的工作原理
探索Cassandra的去中心化分布式架构
Codeforces Global Round 19
[P2P] local packet capturing