极大似然估计

0.极大似然估计

理解:确定合适的参数使得模型对样本的解释性最强。似然的过程就是由样本实际推测模型参数的过程。

以下我们分别考虑总体属于离散型和连续型两种情况下的似然函数及其求解方法。

1.离散型

若总体 X X X​属于离散型,其分布律 P { X = x } = p ( x ; θ ) P\{X=x\}=p(x;\theta) P{X=x}=p(x;θ)​, θ ∈ Θ \theta\in \Theta θΘ​的形式为已知。

其中

  • x x x​​是已知的样本值。
  • θ \theta θ为待估参数, Θ \Theta Θ θ \theta θ可能取值的范围。
  • p ( x ; θ ) p(x;\theta) p(x;θ)​表示在参数取值为 θ \theta θ的前提条件下, X = x X=x X=x​​发生的概率,它是一个条件概率。​​​

X 1 , X 2 , ⋯   , X n X_1,X_2,\cdots,X_n X1,X2,,Xn​​​​是来自 X X X​​​​​的样本,则 X 1 = x 1 , X 2 = x 2 , ⋯   , X n = x n X_1=x_1,X_2=x_2,\cdots,X_n=x_n X1=x1,X2=x2,,Xn=xn同时发生的概率为 ∏ i = 1 n p ( x i ; θ ) \prod_{i=1}^{n}p(x_i;\theta) i=1np(xi;θ)
L ( θ ) = L ( x 1 , x 2 , ⋯   , x n ; θ ) = ∏ i = 1 n p ( x i ; θ ) , θ ∈ Θ (1) L(\theta)=L(x_1,x_2,\cdots,x_n;\theta)=\prod_{i=1}^{n}p(x_i;\theta),\theta \in \Theta \tag{1} L(θ)=L(x1,x2,,xn;θ)=i=1np(xi;θ),θΘ(1)
它是关于 θ \theta θ的函数,随 θ \theta θ的取值而变化 , L ( θ ) ,L(\theta) L(θ)称为样本的似然函数。

似然过程:固定样本观测值 x 1 , x 2 , ⋯   , x n x_1,x_2,\cdots,x_n x1,x2,,xn​​,在 θ \theta θ​​取值的可能范围 Θ \Theta Θ​​内挑选使似然函数 L ( x 1 , x 2 , ⋯   , x n ; θ ) L(x_1,x_2,\cdots,x_n;\theta) L(x1,x2,,xn;θ)​​​达到最大的参数值 θ ^ \hat{\theta} θ^​​​,作为参数 θ \theta θ​​的估计值。
θ ^ = arg max ⁡ θ ∈ Θ   L ( x 1 , x 2 , ⋯   , x n ; θ ) (2) \hat{\theta}={\underset {\theta \in \Theta}{\operatorname{arg\,max}}}\,L(x_1,x_2,\cdots,x_n;\theta) \tag{2} θ^=θΘargmaxL(x1,x2,,xn;θ)(2)
这样得到的 θ ^ \hat{\theta} θ^​​与样本值 x 1 , x 2 , ⋯   , x n x_1,x_2,\cdots,x_n x1,x2,,xn​​有关,常记为 θ ^ ( x 1 , x 2 , ⋯   , x n ) \hat{\theta}(x_1,x_2,\cdots,x_n) θ^(x1,x2,,xn)​​​,称为参数 θ \theta θ​​​的极大似然估计值

2.连续型

若总体 X X X属于连续型,其概率密度 f ( x ; θ ) , θ ∈ Θ f(x;\theta),\theta\in \Theta f(x;θ),θΘ​的形式已知,

同理设 X 1 , X 2 , ⋯   , X n X_1,X_2,\cdots,X_n X1,X2,,Xn​是来自 X X X​的样本,则 X 1 , X 2 , ⋯   , X n X_1,X_2,\cdots,X_n X1,X2,,Xn​的联合密度为 ∏ i = 1 n f ( x i ; θ ) \prod_{i=1}^{n}f(x_i;\theta) i=1nf(xi;θ)​​

x 1 , x 2 , ⋯   , x n x_1,x_2,\cdots,x_n x1,x2,,xn​​是相应于样本 X 1 , X 2 , ⋯   , X n X_1,X_2,\cdots,X_n X1,X2,,Xn​​的一个样本值,则随机点 ( X 1 , X 2 , ⋯   , X n ) (X_1,X_2,\cdots,X_n) (X1,X2,,Xn)​​落在点 ( x 1 , x 2 , ⋯   , x n ) (x_1,x_2,\cdots,x_n) (x1,x2,,xn)​​的邻域(边长分别为 d x 1 , d x 2 , ⋯   , d x n dx_1,dx_2,\cdots,dx_n dx1,dx2,,dxn的n维立方体)内的概率近似地为
∏ i = 1 n f ( x i ; θ ) d x i = ∏ i = 1 n f ( x i ; θ )   ∏ i = 1 n d x i (3) \prod_{i=1}^{n}f(x_i;\theta)dx_i\\ =\prod_{i=1}^{n}f(x_i;\theta)\,\prod_{i=1}^{n}dx_i \tag{3} i=1nf(xi;θ)dxi=i=1nf(xi;θ)i=1ndxi(3)
其值随 θ \theta θ​​的取值而变化,与离散型的情况一样,我们取 θ \theta θ​​的估计值 θ ^ \hat{\theta} θ^​​​使概率取到最大值但因为 ∏ i = 1 n d x i \prod_{i=1}^{n}dx_i i=1ndxi​​不随 θ \theta θ​​而变,故只需考虑似然函数 L ( θ ) L(\theta) L(θ)的最大值。​
L ( θ ) = L ( x 1 , x 2 , ⋯   , x n ; θ ) = ∏ i = 1 n f ( x i ; θ ) , θ ∈ Θ (4) L(\theta)=L(x_1,x_2,\cdots,x_n;\theta)=\prod_{i=1}^{n}f(x_i;\theta),\theta \in \Theta \tag{4} L(θ)=L(x1,x2,,xn;θ)=i=1nf(xi;θ),θΘ(4)
同理,参数 θ \theta θ​​的极大似然估计值为
θ ^ = arg max ⁡ θ ∈ Θ   L ( x 1 , x 2 , ⋯   , x n ; θ ) (5) \hat{\theta}={\underset {\theta \in \Theta}{\operatorname{arg\,max}}}\,L(x_1,x_2,\cdots,x_n;\theta) \tag{5} θ^=θΘargmaxL(x1,x2,,xn;θ)(5)

3.求解过程

在很多情形下, p ( x ; θ ) p(x;\theta) p(x;θ) f ( x ; θ ) f(x;\theta) f(x;θ)关于 θ \theta θ可微,这时 θ ^ \hat{\theta} θ^可从方程
d d θ L ( θ ) = 0 (6) \frac{d}{d\theta}L(\theta)=0 \tag{6} dθdL(θ)=0(6)
解得。

因为式(1)和式(4)两边同时取对数不改变函数的单调性,所以 L ( θ ) L(\theta) L(θ) l n L ( θ ) lnL(\theta) lnL(θ)在同一 θ \theta θ处取得极值。因此, θ \theta θ​的极大似然估计也可以由如下方程求得。
d d θ l n   L ( θ ) = 0 (7) \frac{d}{d\theta}ln\,L(\theta)=0 \tag{7} dθdlnL(θ)=0(7)

4.示例

X ∼ b ( 1 , p ) X\sim b(1,p) Xb(1,p)​​, X X X​服从参数为 p p p​的伯努利分布,它取1的概率为 p p p​,取0的概率为 1 − p 1-p 1p​。 X 1 , X 2 , ⋯   , X n X_1,X_2,\cdots,X_n X1,X2,,Xn​是来自 X X X​的一个样本,试求参数 p p p​​的极大似然估计量

解:设 x 1 , x 2 , ⋯   , x n x_1,x_2,\cdots,x_n x1,x2,,xn是相应于样本 X 1 , X 2 , ⋯   , X n X_1,X_2,\cdots,X_n X1,X2,,Xn的一个样本值。 X X X的分布律为
P ( X = x ) = p x ( 1 − p ) 1 − x , x = 0 , 1 (8) P(X=x)=p^x(1-p)^{1-x},\quad x=0,1 \tag{8} P(X=x)=px(1p)1x,x=0,1(8)
似然函数为
L ( p ) = ∏ i = 1 n p x i ( 1 − p ) 1 − x i = p ∑ i = 1 n x i ( 1 − p ) n − ∑ i = 1 n x i (9) L(p)=\prod_{i=1}^{n}p^{x_i}(1-p)^{1-x_i}=p^{\sum_{i=1}^{n}x_i}(1-p)^{n-\sum_{i=1}^{n}x_i} \tag{9} L(p)=i=1npxi(1p)1xi=pi=1nxi(1p)ni=1nxi(9)
两边同时取对数得
l n   L ( p ) = ∑ i = 1 n x i   l n p + ( n − ∑ i = 1 n x i ) l n ( 1 − p ) (10) ln\,L(p)=\sum_{i=1}^{n}x_i \,lnp+ (n-\sum_{i=1}^{n}x_i)ln(1-p) \tag{10} lnL(p)=i=1nxilnp+(ni=1nxi)ln(1p)(10)

d d p l n   L ( p ) = ∑ i = 1 n x i p − n − ∑ i = 1 n x i 1 − p = 0 (11) \frac{d}{dp}ln\,L(p)=\frac{\sum_{i=1}^{n}x_i}{p}-\frac{n-\sum_{i=1}^{n}x_i}{1-p}=0 \tag{11} dpdlnL(p)=pi=1nxi1pni=1nxi=0(11)
解得 p p p的极大似然估计值为
p ^ = 1 n ∑ i = 1 n x i (12) \hat{p}=\frac{1}{n}\sum_{i=1}^{n}x_i \tag{12} p^=n1i=1nxi(12)

5.拓展

对于含有多个未知参数 θ 1 , θ 2 , ⋯   , θ k \theta_1,\theta_2,\cdots,\theta_k θ1,θ2,,θk的情况,似然函数为 L ( θ 1 , θ 2 , ⋯   , θ k ) L(\theta_1,\theta_2,\cdots,\theta_k) L(θ1,θ2,,θk)​,同单参数求解类似,我们分别对参数 θ i \theta_i θi求偏导并令其偏导为0
∂ ∂ θ i L = 0 , i ∈ { 1 , 2 , ⋯   , k } (13) \frac{\partial}{\partial \theta_i}L=0,i\in \{1,2,\cdots,k\} \tag{13} θiL=0,i{1,2,,k}(13)
或令
∂ ∂ θ i l n   L = 0 , i ∈ { 1 , 2 , ⋯   , k } (14) \frac{\partial}{\partial \theta_i}ln\,L=0,i\in \{1,2,\cdots,k\} \tag{14} θilnL=0,i{1,2,,k}(14)
求解方程组(13)或(14),即可得到各未知参数 θ i \theta_i θi​的极大似然估计值。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值