# 先验后验概率

> 参考：
>
> <https://zh.wikipedia.org/wiki/先验概率>
>
> <https://zh.wikipedia.org/wiki/后验概率>
>
> <https://zh.wikipedia.org/wiki/似然函数>
>
> [https://www.zhihu.com/question/24261751](/machine-learning/ji-qi-xue-xi/shu-xue-ji-chu/gai-lv-tong-ji/xian-yan-hou-yan-gai-lv.md)

## 先验概率：

在贝叶斯统计中，某一不确定量p的先验概率分布是在考虑"观测数据"前，能表达p不确定性的概率分布。它旨在描述这个不确定量的不确定程度，而不是这个不确定量的随机性。这个不确定量可以是一个参数，或者是一个隐含变量（英语：latent variable）。

## 后验概率：

在贝叶斯统计中，一个随机事件或者一个不确定事件的**后验概率**是在考虑和给出相关证据或数据后所得到的条件概率。同样，后验概率分布是一个未知量（视为随机变量）基于试验和调查后得到的概率分布。“后验”在本文中代表考虑了被测试事件的相关证据。

## 似然函数：

在数理统计学中，似然函数是一种关于统计模型中的参数的函数，表示模型参数中的似然性。似然函数在统计推断中有重大作用，如在最大似然估计和费雪信息之中的应用等等。“似然性”与“或然性”或“概率”意思相近，都是指某种事件发生的可能性，但是在统计学中，“似然性”和“或然性”或“概率”又有明确的区分。概率用于在已知一些参数的情况下，预测接下来的观测所得到的结果，而似然性则是用于在已知某些观测所得到的结果时，对有关事物的性质的参数进行估计。

**先验**——根据若干年的统计（经验）或者气候（常识），某地方下雨的概率；

**似然**——下雨（果）的时候有乌云（因 or 证据 or 观察的数据）的概率，即已经有了果，对证据发生的可能性描述；

**后验**——根据天上有乌云（原因或者证据 or 观察数据），下雨（结果）的概率；

后验 \~ 先验\*似然 ： 存在下雨的可能（先验），下雨之前会有乌云（似然）\~ 通过现在有乌云推断下雨概率（后验）；

贝叶斯公式中：

$$
p(\theta | x)=\dfrac{p(x|\theta)p(\theta)}{p(x)}
$$

$$x$$：观察得到的数据（结果）

$$\theta$$：决定数据分布的参数（原因）

$$p(\theta)$$：先验

$$p(\theta|x)$$：后验

$$p(x|\theta)$$：似然


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zhjunqin.gitbook.io/machine-learning/ji-qi-xue-xi/shu-xue-ji-chu/gai-lv-tong-ji/xian-yan-hou-yan-gai-lv.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
