最大似然估计,最大后验估计,概率相关知识
2016-09-23 14:26
351 查看
1、什么是似然函数
The likelihood of a set of parameter values, θ, given outcomes x, is equal to the probability of those observed outcomes given those parameter values, that is
{\displaystyle {\mathcal {L}}(\theta |x)=P(x|\theta
)}
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/5d3451302e5f0de41793e3863bfa260733e46879)
.
The likelihood function is defined differently for discrete and continuous probability distributions.
Let X be a random variable with a discrete probability distribution p depending
on a parameter θ. Then the function
{\displaystyle {\mathcal {L}}(\theta |x)=p_{\theta
}(x)=P_{\theta }(X=x),\,}
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/555e4b8c1a296249de151d6634f6138d2b2104aa)
considered as a function of θ, is called the likelihood function (of θ, given the outcome x of the random
variable X). Sometimes the probability of the value x of X for the parameter value θ is written as {\displaystyle
P(X=x|\theta )}
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/31bb379d0a8a33f8a6e719f1937466c05f63f775)
;
often written as {\displaystyle P(X=x;\theta )}
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/2af8ab27eae14d97390047ebd090255af0da502f)
to
emphasize that this differs from {\displaystyle {\mathcal {L}}(\theta |x)}
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/f298d6a3bd4003c87719e179ef9f1c14c241d230)
which
is not a conditional probability, because θ is a parameter and not a random
variable.
Let X be a random variable following an absolutely
continuous probability distribution with density function f depending
on a parameter θ. Then the function
{\displaystyle {\mathcal {L}}(\theta |x)=f_{\theta
}(x),\,}
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/a164b9795cd3322bed7386369d8f8cc0a79a6092)
considered as a function of θ, is called the likelihood function (of θ, given the outcome x of X). Sometimes the density function for the value x of X for the parameter value θ is written as {\displaystyle
f(x|\theta )}
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/5151115d7ffb7ac662c07581c6594610f37a1d09)
;
this should not be confused with {\displaystyle {\mathcal {L}}(\theta |x)}
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/f298d6a3bd4003c87719e179ef9f1c14c241d230)
which
should not be considered a conditional probability density.
总的来说,似然函数就是,一个概率模型的参数θ还没有确定时,给定一组已经发生的样本(输出给定)X,这个参数θ的似然L(θ|X)定义为:
在参数为θ时,样本X发生的概率。
2、最大似然估计的步骤
2.1离散型变量
我们现在有一组样本,样本数量为n,分别是,X1,X2,X3,X4,...,Xn
我们现在的概率模型中有k个参数θ1,...,θk,记做θall
(1)得到表达式
若为离散型随机变量,一般情况下我们都会假设变量之间相互独立,那么似然函数为
L(θall|X1,X2,..Xn)=P(X1|θall)*P(X2|θall)*....*P(Xn|θall)
L(似然值)=各个样本在θ1,...,θk这一组参数下的概率的乘积
(2)求解最大值
这是一个关于θ1,...,θk的k元函数,以为这组样本已经发生,所以概率值越大越好
我们要求这个函数的最大值,这也就变成了一个最优化问题。
关于离散型求解方法,进一步研究,不知道求导是否可行
2.2连续性变量
(1)连续性变量道理一致,只需要将概率P改成概率密度函数。
L(θall|X1,X2,..Xn)=f(X1|θall)*f(X2|θall)*....*f(Xn|θall)
(2)两边取对数,因为对数函数是单调递增,所以最大值点相同,不受影响
ln L(θall|X1,X2,..Xn)=ln f(X1|θall)+
ln f(X2|θall)+...+ln f(Xn|θall)
(3)求ln(L)对θ1,θ2,....θn的偏导数,另各阶偏导数为0,得到n个方程,这样就能解得函数极值点。
(4)如果不能求根,或者导数不存在,就要考虑其他方法。
3、贝叶斯公式
贝叶斯定理由英国数学家贝叶斯
( Thomas Bayes 1702-1761 ) 发展,用来描述两个条件概率之间的关系,
比如
P(A|B) 和 P(B|A)。按照乘法法则,可以立刻导出:
P(A∩B)
= P(A)*P(B|A)=P(B)*P(A|B)。
如上公式等式的后两项也可变形为:
P(B|A)
= P(A|B)*P(B) / P(A)。
贝叶斯公式就是刻画了两个条件概率的相互关系,并没有什么特别之处。
后验估计时,把参数当成了随机变量,那么参数和样本就是两个互相作用的条件概率。
3、后验概率
The posterior probability
is the probability of the parameters {\displaystyle
\theta }
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/6e5ab2664b422d53eb0c7df3b87e1360d75ad9af)
given
the evidence {\displaystyle
X}
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab)
: {\displaystyle
p(\theta |X)}
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/2594603c1c2b622471d9a19d1ea54daa152026b4)
.
注意后验概率把参数当成了随机变量,求的是在样本发生的情况下,参数是
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/6e5ab2664b422d53eb0c7df3b87e1360d75ad9af)
的概率
这与参数似然不同,参数
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/6e5ab2664b422d53eb0c7df3b87e1360d75ad9af)
的似然实际上还是求的在参数是
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/6e5ab2664b422d53eb0c7df3b87e1360d75ad9af)
的时候,给定的那组样本发生的概率。
后验概率可以通过先验概率和似然函数求得,也就是通过贝叶斯公式,
P(A|B)=P(B|A)*P(A)/ P(B)
理解:
(1)P(参数|样本)=P(样本|参数)*P(参数的先验概率)/P(样本的先验概率)
(2)后验概率 = (似然度 * 先验概率)/标准化常量 也就是说,后验概率与先验概率和似然度的乘积成正比。
很明显 P(样本|参数)就是参数的似然,所以我们有一个正比关系:
![](https://wikimedia.org/api/rest_v1/media/math/render/svg/4a6a4e24770649d40c92309d71c0787f3d58d168)
.
The likelihood of a set of parameter values, θ, given outcomes x, is equal to the probability of those observed outcomes given those parameter values, that is
{\displaystyle {\mathcal {L}}(\theta |x)=P(x|\theta
)}
.
The likelihood function is defined differently for discrete and continuous probability distributions.
Discrete probability distribution
Let X be a random variable with a discrete probability distribution p dependingon a parameter θ. Then the function
{\displaystyle {\mathcal {L}}(\theta |x)=p_{\theta
}(x)=P_{\theta }(X=x),\,}
considered as a function of θ, is called the likelihood function (of θ, given the outcome x of the random
variable X). Sometimes the probability of the value x of X for the parameter value θ is written as {\displaystyle
P(X=x|\theta )}
;
often written as {\displaystyle P(X=x;\theta )}
to
emphasize that this differs from {\displaystyle {\mathcal {L}}(\theta |x)}
which
is not a conditional probability, because θ is a parameter and not a random
variable.
Continuous probability distribution
Let X be a random variable following an absolutelycontinuous probability distribution with density function f depending
on a parameter θ. Then the function
{\displaystyle {\mathcal {L}}(\theta |x)=f_{\theta
}(x),\,}
considered as a function of θ, is called the likelihood function (of θ, given the outcome x of X). Sometimes the density function for the value x of X for the parameter value θ is written as {\displaystyle
f(x|\theta )}
;
this should not be confused with {\displaystyle {\mathcal {L}}(\theta |x)}
which
should not be considered a conditional probability density.
总的来说,似然函数就是,一个概率模型的参数θ还没有确定时,给定一组已经发生的样本(输出给定)X,这个参数θ的似然L(θ|X)定义为:
在参数为θ时,样本X发生的概率。
2、最大似然估计的步骤
2.1离散型变量
我们现在有一组样本,样本数量为n,分别是,X1,X2,X3,X4,...,Xn
我们现在的概率模型中有k个参数θ1,...,θk,记做θall
(1)得到表达式
若为离散型随机变量,一般情况下我们都会假设变量之间相互独立,那么似然函数为
L(θall|X1,X2,..Xn)=P(X1|θall)*P(X2|θall)*....*P(Xn|θall)
L(似然值)=各个样本在θ1,...,θk这一组参数下的概率的乘积
(2)求解最大值
这是一个关于θ1,...,θk的k元函数,以为这组样本已经发生,所以概率值越大越好
我们要求这个函数的最大值,这也就变成了一个最优化问题。
关于离散型求解方法,进一步研究,不知道求导是否可行
2.2连续性变量
(1)连续性变量道理一致,只需要将概率P改成概率密度函数。
L(θall|X1,X2,..Xn)=f(X1|θall)*f(X2|θall)*....*f(Xn|θall)
(2)两边取对数,因为对数函数是单调递增,所以最大值点相同,不受影响
ln L(θall|X1,X2,..Xn)=ln f(X1|θall)+
ln f(X2|θall)+...+ln f(Xn|θall)
(3)求ln(L)对θ1,θ2,....θn的偏导数,另各阶偏导数为0,得到n个方程,这样就能解得函数极值点。
(4)如果不能求根,或者导数不存在,就要考虑其他方法。
3、贝叶斯公式
贝叶斯定理由英国数学家贝叶斯
( Thomas Bayes 1702-1761 ) 发展,用来描述两个条件概率之间的关系,
比如
P(A|B) 和 P(B|A)。按照乘法法则,可以立刻导出:
P(A∩B)
= P(A)*P(B|A)=P(B)*P(A|B)。
如上公式等式的后两项也可变形为:
P(B|A)
= P(A|B)*P(B) / P(A)。
贝叶斯公式就是刻画了两个条件概率的相互关系,并没有什么特别之处。
后验估计时,把参数当成了随机变量,那么参数和样本就是两个互相作用的条件概率。
3、后验概率
The posterior probability
is the probability of the parameters {\displaystyle
\theta }
given
the evidence {\displaystyle
X}
: {\displaystyle
p(\theta |X)}
.
注意后验概率把参数当成了随机变量,求的是在样本发生的情况下,参数是
的概率
这与参数似然不同,参数
的似然实际上还是求的在参数是
的时候,给定的那组样本发生的概率。
后验概率可以通过先验概率和似然函数求得,也就是通过贝叶斯公式,
P(A|B)=P(B|A)*P(A)/ P(B)
理解:
(1)P(参数|样本)=P(样本|参数)*P(参数的先验概率)/P(样本的先验概率)
(2)后验概率 = (似然度 * 先验概率)/标准化常量 也就是说,后验概率与先验概率和似然度的乘积成正比。
很明显 P(样本|参数)就是参数的似然,所以我们有一个正比关系:
.
相关文章推荐
- 最大似然估计(MLE)最大后验概率估计(MAP)以及贝叶斯公式的理解
- 最大似然估计和最大后验概率估计
- 语音识别一些概率知识--似然估计/最大似然估计/高斯混合模型
- 最大似然估计(MLE)和最大后验概率估计(MAP)
- 先验概率/后验概率/最大似然估计
- 参数估计:最大似然估计(MLE),最大后验估计(MAP),贝叶斯估计,经验贝叶斯(Empirical Bayes)与全贝叶斯(Full Bayes)
- 概率统计之最大似然估计
- 特定条件下结构风险最小化等价于最大后验概率估计得证明
- 最大似然估计和最大后验概率
- 最大似然估计MLE_和_最大后验概率MAP 的区别与联系
- [置顶] 极大似然估计,最大后验概率估计(MAP),贝叶斯估计
- 概率随机问题【1】相关C语言知识
- 最大后验概率估计(Maximum a Posteriori Estimation,MAPE)
- 先验概率、最大似然估计、贝叶斯估计、最大后验概率
- 机器学习->统计学基础->贝叶斯估计,最大似然估计(MLE),最大后验估计(MAP)
- 最大似然估计和最大后验估计
- 最大后验概率估计算法(简单,通俗易懂)
- 最大似然估计和最大后验概率
- 先验概率、后验概率与最大似然估计
- 极大似然估计&最大后验概率估计