Skip to content

9회 · 최대가능도 · 워크북

D. 퀄형 ​

여러 절의 도구를 잇는 종합 문제다. 머리의 제한 시간을 재고, 노트를 덮고 푼다. 가능도를 정확히 적는 것부터 답안의 일부다. 정규분위수는 z0.025=1.96z_{0.025}=1.96, χ1,0.052=3.84\chi^2_{1,0.05}=3.84를 쓴다.

D1 중도절단된 수명 ★★★ ​

정리 1.6, 2.2, 3.1 · 제한 45분

전구 nn개의 수명 Xi∼iidExpX_i\iid\mathrm{Exp} (비율 λ\lambda)를 시각 cc까지만 지켜본다. 관측은 Yi=min⁡(Xi,c)Y_i=\min(X_i,c)와 δi=1{Xi≤c}\delta_i=1\{X_i\le c\}이다. d=∑δid=\sum\delta_i는 꺼진 전구의 수, T=∑YiT=\sum Y_i는 총 관측 시간이다.

  1. (a)

    한 관측 (y,δ)(y,\delta)의 가능도가 λδe−λy\lambda^\delta e^{-\lambda y}임을 보이고, d≥1d\ge1이면 MLE가 λ^=d/T\hat\lambda=d/T임을 보여라.

  2. (b)

    한 관측의 Fisher 정보가 I(λ)=1−e−λcλ2I(\lambda)=\tfrac{1-e^{-\lambda c}}{\lambda^2}임을 보여라. (check()에는 λ\lambda를 lam으로 쓴다.)

  3. (c)

    n=50n=50, d=30d=30, T=120T=120이면 λ^\hat\lambda는 얼마인가?

  4. (d)

    (c)에서 관측 정보 −ℓ′′(λ^)-\ell''(\hat\lambda)로 만든 표준오차를 구하고, 95% 구간을 써라.

힌트

(a) 꺼진 전구는 밀도 λe−λy\lambda e^{-\lambda y}, 아직 켜진 전구는 생존확률 P(X>c)=e−λcP(X>c)=e^{-\lambda c}를 기여한다. (b) ℓ′′=−δ/λ2\ell''=-\delta/\lambda^2이고 Eδ=1−e−λcE\delta=1-e^{-\lambda c}.

풀이

(a) δ=1\delta=1이면 X=y≤cX=y\le c의 밀도 λe−λy\lambda e^{-\lambda y}, δ=0\delta=0이면 P(X>c)=e−λc=e−λyP(X>c)=e^{-\lambda c}=e^{-\lambda y} (y=cy=c)이다. 둘을 합치면 λδe−λy\lambda^\delta e^{-\lambda y}이다. ℓ(λ)=dlog⁡λ−λT\ell(\lambda)=d\log\lambda-\lambda T, ℓ′(λ)=dλ−T=0\ell'(\lambda)=\tfrac d\lambda-T=0에서 λ^=d/T\hat\lambda=d/T이고 ℓ′′=−d/λ2<0\ell''=-d/\lambda^2<0이므로 최대점이다. d=0d=0이면 ℓ\ell은 증가하지 않고 최대점이 λ=0\lambda=0 쪽 경계에 있다. (b) 한 관측의 ∂2∂λ2log⁡f=−δλ2\tfrac{\partial^2}{\partial\lambda^2}\log f=-\tfrac\delta{\lambda^2}이므로 I(λ)=Eδλ2=1−e−λcλ2I(\lambda)=\tfrac{E\delta}{\lambda^2}=\tfrac{1-e^{-\lambda c}}{\lambda^2}이다(정리 2.2). c→∞c\to\infty이면 완전한 관측의 1/λ21/\lambda^2이다. 지켜보지 못한 부분만큼 정보가 준다. (c) λ^=30/120=0.25\hat\lambda=30/120=0.25. (d) −ℓ′′(λ^)=d/λ^2-\ell''(\hat\lambda)=d/\hat\lambda^2이므로 표준오차는 λ^/d=0.25/30≈0.0456\hat\lambda/\sqrt d=0.25/\sqrt{30}\approx0.0456이고, 95% 구간은 0.25±0.0894=[0.161, 0.339]0.25\pm0.0894=[0.161,\ 0.339]이다(따름정리 3.2(a)).

최종답 (b) 1−e−λcλ2\tfrac{1-e^{-\lambda c}}{\lambda^2} (c) 0.250.25 (d) 0.2530≈0.0456\tfrac{0.25}{\sqrt{30}}\approx0.0456

D2 Neyman–Scott, kk번 측정 ★★★ ​

정리 3.1, 7회 정리 1.6 · 제한 30분

nn명에게서 kk번씩 측정한다: Xij∼iidN(μi,σ2)X_{ij}\iid\N(\mu_i,\sigma^2), i=1,…,ni=1,\dots,n, j=1,…,kj=1,\dots,k (k≥2k\ge2 고정).

  1. (a)

    (μ1,…,μn,σ2)(\mu_1,\dots,\mu_n,\sigma^2)의 MLE를 구하라.

  2. (b)

    n→∞n\to\infty에서 σ^2\hat\sigma^2의 확률극한을 kk와 σ2\sigma^2의 식으로 구하라. (check()에는 σ\sigma를 sigma로 쓴다.)

  3. (c)

    σ^2\hat\sigma^2에 곱해 일치추정량을 만드는 상수를 구하라. 정리 3.1의 어느 가정이 깨졌는가?

힌트

∑j(Xij−Xˉi)2/σ2∼χ2(k−1)\sum_j(X_{ij}-\bar X_i)^2/\sigma^2\sim\chi^2(k-1)이고 사람마다 독립이다(6회 정리 2.2).

풀이

(a) σ2\sigma^2을 고정하면 μi\mu_i는 사람 ii의 제곱합만 최소화하므로 μ^i=Xˉi\hat\mu_i=\bar X_i이다. 이것을 넣고 σ2\sigma^2로 미분하면 σ^2=1nk∑i∑j(Xij−Xˉi)2\hat\sigma^2=\tfrac1{nk}\sum_i\sum_j(X_{ij}-\bar X_i)^2이다. (b) Wi=∑j(Xij−Xˉi)2W_i=\sum_j(X_{ij}-\bar X_i)^2는 iid이고 EWi=(k−1)σ2EW_i=(k-1)\sigma^2이다(6회 정리 2.2, χ2(k−1)\chi^2(k-1)의 평균). 대수의 법칙으로 σ^2=1k⋅1n∑Wi→Pk−1kσ2\hat\sigma^2=\tfrac1k\cdot\tfrac1n\sum W_i\xrightarrow{P}\tfrac{k-1}k\sigma^2이다. (c) kk−1\tfrac k{k-1}을 곱하면 1n(k−1)∑Wi→Pσ2\tfrac1{n(k-1)}\sum W_i\xrightarrow{P}\sigma^2이다. 정리 3.1은 모수의 수가 고정되어 있다고 가정했는데, 여기서는 모수가 n+1n+1개로 자료와 함께 는다. k=2k=2이면 노트 예제 7.2의 12\tfrac12이다.

최종답 (b) k−1kσ2\tfrac{k-1}k\sigma^2 (c) kk−1\tfrac k{k-1}

D3 Hardy–Weinberg 평형 ★★★ ​

정리 2.2, 5.2, 8회 정리 5.1 · 제한 40분

유전자형 AA, Aa, aa의 확률이 Hardy–Weinberg 모형에서 θ2\theta^2, 2θ(1−θ)2\theta(1-\theta), (1−θ)2(1-\theta)^2이다. 100명을 조사해 (n1,n2,n3)=(50,30,20)(n_1,n_2,n_3)=(50,30,20)을 얻었다.

  1. (a)

    θ\theta의 MLE가 2n1+n22n\tfrac{2n_1+n_2}{2n}임을 보이고 값을 구하라.

  2. (b)

    한 사람의 Fisher 정보 I(θ)I(\theta)를 구하라.

  3. (c)

    모형이 맞는지를 일반 다항 모형에 대해 가능도비로 검정하라. G=2∑Olog⁡OEG=2\sum O\log\tfrac OE를 구하라. 자유도는?

  4. (d)

    Pearson의 X2=∑(O−E)2EX^2=\sum\tfrac{(O-E)^2}E도 구하고 결론을 내려라.

힌트

(a) ℓ=(2n1+n2)log⁡θ+(n2+2n3)log⁡(1−θ)+\ell=(2n_1+n_2)\log\theta+(n_2+2n_3)\log(1-\theta)+상수. 유전자 2n2n개 가운데 A의 수를 세는 것과 같다. (b) 한 사람의 A 유전자 수는 Binomial(2,θ)(2,\theta)이다. (c) 기대도수는 100θ^2100\hat\theta^2 등이다.

풀이

(a) ℓ′(θ)=2n1+n2θ−n2+2n31−θ=0\ell'(\theta)=\tfrac{2n_1+n_2}\theta-\tfrac{n_2+2n_3}{1-\theta}=0에서 θ^=2n1+n22n=130200=0.65\hat\theta=\tfrac{2n_1+n_2}{2n}=\tfrac{130}{200}=0.65이다. (b) 한 사람의 로그가능도는 A의 수 Y∼Bin(2,θ)Y\sim\mathrm{Bin}(2,\theta)에 대해 Ylog⁡θ+(2−Y)log⁡(1−θ)Y\log\theta+(2-Y)\log(1-\theta)이므로 I(θ)=2θ(1−θ)I(\theta)=\tfrac{2}{\theta(1-\theta)}이다. (c) 기대도수는 100⋅0.4225=42.25100\cdot0.4225=42.25, 100⋅0.455=45.5100\cdot0.455=45.5, 100⋅0.1225=12.25100\cdot0.1225=12.25이다. G=2[50log⁡5042.25+30log⁡3045.5+20log⁡2012.25]≈11.46G=2\bigl[50\log\tfrac{50}{42.25}+30\log\tfrac{30}{45.5}+20\log\tfrac{20}{12.25}\bigr]\approx11.46이다. 일반 다항 모형의 자유로운 모수는 2개, Hardy–Weinberg는 1개이므로 자유도는 1이다(노트 5.1절의 상자). (d) X2=7.75242.25+15.5245.5+7.75212.25≈11.60X^2=\tfrac{7.75^2}{42.25}+\tfrac{15.5^2}{45.5}+\tfrac{7.75^2}{12.25}\approx11.60이다. 둘 다 3.843.84를 크게 넘으므로(p≈0.0007p\approx0.0007) Hardy–Weinberg 평형을 기각한다. 이형접합 Aa가 기대보다 적다.

최종답 (a) 0.650.65 (b) 2θ(1−θ)\tfrac{2}{\theta(1-\theta)} (c) G≈11.46G\approx11.46 (d) X2≈11.60X^2\approx11.60

D4 변동계수가 1인 정규 ★★★ ​

정리 1.6, 2.2, 3.1 · 제한 35분

Xi∼iidN(θ,θ2)X_i\iid\N(\theta,\theta^2), θ>0\theta>0이다. xˉ=1n∑xi\bar x=\tfrac1n\sum x_i, m2=1n∑xi2m_2=\tfrac1n\sum x_i^2으로 쓴다.

  1. (a)

    가능도 방정식이 θ2+xˉθ−m2=0\theta^2+\bar x\theta-m_2=0임을 보이고 MLE를 xˉ\bar x와 m2m_2의 식으로 구하라. (check()에는 xbar, m2로 쓴다.)

  2. (b)

    한 관측의 Fisher 정보 I(θ)I(\theta)를 구하라.

  3. (c)

    Xˉ\bar X도 θ\theta의 불편추정량이다. Xˉ\bar X의 점근 효율 1/(nI)Var⁡Xˉ\tfrac{1/(nI)}{\Var\bar X}를 구하라.

  4. (d)

    xˉ=2\bar x=2, m2=6m_2=6이면 θ^\hat\theta는 얼마인가?

힌트

(a) ℓ(θ)=−nlog⁡θ−12θ2∑(xi−θ)2+\ell(\theta)=-n\log\theta-\tfrac{1}{2\theta^2}\sum(x_i-\theta)^2+상수. θ3\theta^3을 곱해 정리한다. 양의 근을 고른다. (b) ∂2∂θ2log⁡f\tfrac{\partial^2}{\partial\theta^2}\log f의 기댓값에 E(X−θ)=0E(X-\theta)=0, E(X−θ)2=θ2E(X-\theta)^2=\theta^2을 넣는다.

풀이

(a) ℓ′(θ)=−nθ+∑(xi−θ)2θ3+∑(xi−θ)θ2\ell'(\theta)=-\tfrac n\theta+\tfrac{\sum(x_i-\theta)^2}{\theta^3}+\tfrac{\sum(x_i-\theta)}{\theta^2}이다. θ3/n\theta^3/n을 곱하면 −θ2+(m2−2θxˉ+θ2)+θ(xˉ−θ)=m2−θxˉ−θ2=0-\theta^2+(m_2-2\theta\bar x+\theta^2)+\theta(\bar x-\theta)=m_2-\theta\bar x-\theta^2=0이다. 양의 근은 θ^=−xˉ+xˉ2+4m22\hat\theta=\tfrac{-\bar x+\sqrt{\bar x^2+4m_2}}2이다. 두 근의 곱이 −m2<0-m_2<0이므로 양의 근은 하나다. (b) log⁡f=−log⁡θ−(x−θ)22θ2+\log f=-\log\theta-\tfrac{(x-\theta)^2}{2\theta^2}+상수에서 ∂2∂θ2log⁡f=1θ2−3θ4(x−θ)2−4θ3(x−θ)−1θ2\tfrac{\partial^2}{\partial\theta^2}\log f=\tfrac1{\theta^2}-\tfrac3{\theta^4}(x-\theta)^2-\tfrac4{\theta^3}(x-\theta)-\tfrac1{\theta^2}이다. 기댓값은 1θ2−3θ2−0−1θ2=−3θ2\tfrac1{\theta^2}-\tfrac3{\theta^2}-0-\tfrac1{\theta^2}=-\tfrac3{\theta^2}이므로 I(θ)=3θ2I(\theta)=\tfrac3{\theta^2}이다. (c) Var⁡Xˉ=θ2n\Var\bar X=\tfrac{\theta^2}n이고 한계는 θ23n\tfrac{\theta^2}{3n}이므로 효율은 13\tfrac13이다. 표본평균은 분산에 들어 있는 정보를 버린다. (d) θ^=−2+4+242=7−1≈1.646\hat\theta=\tfrac{-2+\sqrt{4+24}}2=\sqrt7-1\approx1.646이다.

최종답 (a) −xˉ+xˉ2+4m22\tfrac{-\bar x+\sqrt{\bar x^2+4m_2}}2 (b) 3/θ23/\theta^2 (c) 13\tfrac13 (d) 7−1≈1.646\sqrt7-1\approx1.646