就拿上面 三硬币模型 来说,其似然函数可写为,
P(Y∣θ)=j=1∏n[πpyj(1−p)1−yj+(1−π)qyj(1−q)1−yj]所以似然估计为
θ^=argθmaxlogP(Y∣θ)即求下面函数的零点:
j=1∑nlog(πpyj(1−p)1−yj+(1−π)qyj(1−q)1−yj)分别对 π,p,q 求偏导:
∂π∂logP(Y∣θ)∂p∂logP(Y∣θ)∂q∂logP(Y∣θ)=j=1∑npyiπ(1−p)1−yi−qyi(1−q)1−yi(π−1)pyi(1−p)1−yi−qyi(1−q)1−yi=j=1∑np(p−1)(pyiπ(1−p)1−yi−qyi(1−q)1−yi(π−1))π(−pyiyi(1−p)2−yi+pyi+1(1−p)1−yi(1−yi))=j=1∑nq(q−1)(pyiπ(1−p)1−yi−qyi(1−q)1−yi(π−1))(π−1)(qyiyi(1−q)2−yi+qyi+1(1