正在加载图片...
The log-likelihood function is C= >(logc(n,)+logp+(n-x)log(1-p)) 71 (7) logC(n,j) k logp +(n-k)log(1-p). The maximum likelihood estimator(MLE)of p is k/n. 1.2 Implementation Issue Reasonable algorithms for F(k)return the appropriate values for large n and small k but succumb to numeric underflow for large k. For example,since Fp(0)=(1-p)"and Fp(n-1)=1-p",set n 100 and p =0.6 to get F10,0.6(0)=(1-0.6)100=0.4100兰1.6×10-40 (8) and F00,0.6(99)=1-0.6100=1-6.5×10-23 (9) But with standard double precision resolution of about 16 decimal places,the result is F100.0.(99)=1 exactly.The cure for lower tail probabilities too close to 1 is to use upper tail probabilities,which will be close to 0,and work with G instead of F,since Gn.p(n)=p"=1- Frtp (n -1),and so G1000.6(100)=0.610=1-F1000.6(99)=1-(1-0.6)100兰6.5×10-23 (10) But naive use of Gnp(k)=1-Fp(k-1)directly will of course give G100.0.6(100)=0.To obtain a useful representation of G(k)with k large in terms of an accurate algorithm for F(k) with k small,let X ~Bn,p and W=n-X.Note that Fw(k)=Pr[Wsk]Pr[n-Xk] Pr[X z n-k]=1-Pr[X n-k]1-Pr[X <n-k-1]=1-Fx(n-k-1).Then Gx(k)=1-Fx(k-1)=1-Fx(n-(n-k)-1)=Fw(n-k),so Gnp(k)=Pr[Bnp <k]=Pr[Bn1-p <n-k]=Fn1-p(n-k). (11) This givesG1o0,0.6(100)=Fo0,0.4(0)=(1-0.4)100=0.6100兰6.5×10-23 as required. 44 The log-likelihood function is ℒ = ��log 𝐶𝐶(𝑛𝑛,𝑗𝑗) + 𝑋𝑋𝑗𝑗 log 𝑝𝑝 + �𝑛𝑛 − 𝑋𝑋𝑗𝑗 � log(1 − 𝑝𝑝)� 𝑛𝑛 𝑗𝑗=0 = ��log 𝐶𝐶(𝑛𝑛,𝑗𝑗) 𝑛𝑛 𝑗𝑗=0 � + 𝑘𝑘 log 𝑝𝑝 + (𝑛𝑛 − 𝑘𝑘) log(1 − 𝑝𝑝) . (7) The maximum likelihood estimator (MLE) of p is 𝑘𝑘 𝑛𝑛⁄ . 1.2 Implementation Issue Reasonable algorithms for 𝐹𝐹𝑛𝑛,𝑝𝑝 (𝑘𝑘) return the appropriate values for large n and small k but succumb to numeric underflow for large k. For example, since 𝐹𝐹𝑛𝑛,𝑝𝑝 (0) = (1 − 𝑝𝑝)𝑛𝑛 and 𝐹𝐹𝑛𝑛,𝑝𝑝 (𝑛𝑛 − 1) = 1 − 𝑝𝑝𝑛𝑛 , set 𝑛𝑛 = 100 and 𝑝𝑝 = 0.6 to get 𝐹𝐹100,0.6(0) = (1 − 0.6)100 = 0.4100 ≅ 1.6 × 10−40 (8) and 𝐹𝐹100,0.6(99) = 1 − 0.6100 ≅ 1 − 6.5 × 10−23. (9) But with standard double precision resolution of about 16 decimal places, the result is 𝐹𝐹100,0.6(99) = 1 exactly. The cure for lower tail probabilities too close to 1 is to use upper tail probabilities, which will be close to 0, and work with G instead of F, since 𝐺𝐺𝑛𝑛,𝑝𝑝 (𝑛𝑛) = 𝑝𝑝𝑛𝑛 = 1 − 𝐹𝐹𝑛𝑛,𝑝𝑝 (𝑛𝑛 − 1), and so 𝐺𝐺100,0.6(100) = 0.6100 = 1 − 𝐹𝐹100,0.6(99) = 1 − (1 − 0.6)100 ≅ 6.5 × 10−23. (10) But naïve use of 𝐺𝐺𝑛𝑛,𝑝𝑝 (𝑘𝑘) = 1 − 𝐹𝐹𝑛𝑛,𝑝𝑝 (𝑘𝑘 − 1) directly will of course give 𝐺𝐺100,0.6(100) = 0. To obtain a useful representation of 𝐺𝐺(𝑘𝑘) with k large in terms of an accurate algorithm for 𝐹𝐹(𝑘𝑘) with k small, let 𝑋𝑋 ~𝐵𝐵𝑛𝑛,𝑝𝑝 and 𝑊𝑊 = 𝑛𝑛 − 𝑋𝑋. Note that 𝐹𝐹𝑊𝑊(𝑘𝑘) = Pr[ 𝑊𝑊 ≤ 𝑘𝑘] = Pr[ 𝑛𝑛 − 𝑋𝑋 ≤ 𝑘𝑘] = Pr[𝑋𝑋 ≥ 𝑛𝑛 − 𝑘𝑘] = 1 − Pr[𝑋𝑋 < 𝑛𝑛 − 𝑘𝑘] = 1 − Pr[𝑋𝑋 ≤ 𝑛𝑛 − 𝑘𝑘 − 1] = 1 − 𝐹𝐹𝑋𝑋(𝑛𝑛 − 𝑘𝑘 − 1) . Then 𝐺𝐺𝑋𝑋(𝑘𝑘) = 1 − 𝐹𝐹𝑋𝑋(𝑘𝑘 − 1) = 1 − 𝐹𝐹𝑋𝑋(𝑛𝑛 − (𝑛𝑛 − 𝑘𝑘) − 1) = 𝐹𝐹𝑊𝑊(𝑛𝑛 − 𝑘𝑘), so 𝐺𝐺𝑛𝑛,𝑝𝑝 (𝑘𝑘) = 𝑃𝑃𝑃𝑃�𝐵𝐵𝑛𝑛,𝑝𝑝 ≤ 𝑘𝑘� = Pr�𝐵𝐵𝑛𝑛,1−𝑝𝑝 ≤ 𝑛𝑛 − 𝑘𝑘� = 𝐹𝐹𝑛𝑛,1−𝑝𝑝(𝑛𝑛 − 𝑘𝑘). (11) This gives 𝐺𝐺100,0.6(100) = 𝐹𝐹100,0.4(0) = (1 − 0.4)100 = 0.6100 ≅ 6.5 × 10−23 as required
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有