小白对最小二乘估计、最大似然估计和最大后验估计的理解

这三者的联系非常紧密
最小二乘估计(LLS)

首先假设直线为 y = a x + b y=ax+b y=ax+b我们的目标函数就可以设为 χ 2 = Σ i n ( y i − y ( x i ) ) 2 \chi^2=\Sigma_i^n(y_i-y(x_i))^2 χ2=Σin(yiy(xi))2最小二乘估计比较简单易懂,只需把数据代入这个公式,然后求导等于零,就可以算出a和b的值。
**改进的最小二乘估计方法(MLS):**引入数据的权重来改进估计,提高估计的可信度,具体的方法时在上式中加入权重系数 w i = 1 / σ i 2 w_i=1/\sigma_i^2 wi=1/σi2则原来的公式变为: χ 2 = Σ i n w i ( y i − y ( x i ) ) 2 \chi^2=\Sigma_i^nw_i(y_i-y(x_i))^2 χ2=Σinwi(yiy(xi))2

最大似然估计(MLE)

最大似然的原理是: L ( p a r a m e t e r ∣ d a t a ) = p ( d a t a ∣ p a r a m e t e r ) L(parameter|data)=p(data|parameter) L(parameterdata)=p(dataparameter)
也就是概率大小是根据参数来确定的,反过来,参数的大小也可以由概率来推断,为了表示区别,对参数的估计被称为似然估计。
Maximum Likelihood Estimation seeks the solution that “best” explains the observed data set. θ M L = a r g m a x θ P ( X ∣ θ ) \theta^{ML}=argmax_\theta P(X|\theta) θML=argmaxθP(Xθ) = a r g m a x θ l o g P ( X ∣ θ ) =argmax_\theta logP(X|\theta) =argmaxθlogP(Xθ)
举一个例子:
Example: Coin flipping

  • Suppose we have been given data from a series of m coin flips, and we are not sure if the coin is fair or not.
  • We might assume that the data were generated by a sequence of independent draws from a Bernoulli distribution, parameterized by θ \theta θ, which is the probability of flipping Heads.
  • But what’s the value of θ \theta θ?That is, which Bernoulli distribution generated these data?
  • We could estimate θ \theta θ as the proportion of the flips that are Heads. We will see shortly that this is a principled Bayesian approach. Let y i = 1 y_i=1 yi=1if flip i i i was Heads, and y i = 0 y_i=0 yi=0 otherwise. Let m H = Σ i = 1 m y i m_H=\Sigma_{i=1}^my_i mH=Σi=1myi be the number of heads in m m m tosses. Then the likelihood model is p ( y ∣ θ ) = θ m H ( 1 − θ ) m − m H p(y|\theta)=\theta ^{m_H}(1-\theta)^{m-m_H} p(yθ)=θmH(1θ)mmH

这里补充一点大数定律和中心极限定律的知识:
大数定律:在随机事件的大量重复出现中,往往呈现几乎必然的规律。在试验不变的条件下,重复试验多次,随机事件的概率近似于它出现的频率。这是概率论的重要基石。

中心极限定律:在一定条件下,大量独立随机变量的平均数是以正态分布为极限的。
最大似然估计与最小二乘估计的联系:如果模型假设为 y = α + β x + ϵ y=\alpha+\beta x+\epsilon y=α+βx+ϵ其中 ϵ 服 从 N ( 0 , σ 2 ) \epsilon服从N(0, \sigma^2) ϵN(0,σ2),则 y i 服 从 N ( α + β x i , σ 2 ) y_i服从N(\alpha+\beta x_i, \sigma^2) yiN(α+βxi,σ2),则可以得到最大似然估计:
L = ( 2 π σ 2 ) − n / 2 e x p [ − 1 2 σ 2 Σ i = 1 n ( y i − α − β i x ) 2 ] L=(2\pi\sigma^2)^{-n/2}exp[\frac{-1}{2\sigma^2}\Sigma_{i=1}^n(y_i-\alpha-\beta _ix)^2] L=(2πσ2)n/2exp[2σ21Σi=1n(yiαβix)2]
求解可得:
α = y ˉ − β x ˉ \alpha =\bar y - \beta\bar x α=yˉβxˉ
β = Σ y i ( x i − x ˉ ) Σ ( x i − x ˉ ) 2 \beta=\frac{\Sigma y_i(x_i-\bar x)}{\Sigma (x_i-\bar x)^2} β=Σ(xixˉ)2Σyi(xixˉ)
推到这里你会惊奇的发现,这里的结果和不加权的最小二乘估计的结果是一样的,神奇不

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值