Example) Mathematical Statistics and Data Analysis, 3ED, Chapter8. Q8
In an ecological study of the feeding behavior of birds, the number of hos between flights was counted for several birds. For the following data, (a) fit a geometric distribution, (b) find an approximate 95% confidence interval for p.
(# Hops, Frequency)= (1, 48) (2, 31) (3, 20) (4, 9) (5, 6) (6,5) (7,4) (8,2) (9,1) (10,1) (11,2) (12,1)
If X follows Geometric Distribution, then P(X=k)=$P(X=k)=p(1-p)^{k-1}$, k=1,2,3...
$\triangleright$ Solution (a)
$\hat{p}= \frac {1}{\bar{x}}$, $f(k)= N \cdot P(X=k)$
$\rightarrow \hat{p}= \frac {\sum f_{i}}{\sum f_i \cdot x_i} = \frac {130}{363}=0.3581$
$\triangleright$ Solution (b)
The easiest is to use MLE and get the estimated variance from the curvature of likelihood function.
$L(p)=\prod_{i=1}^{n}p(1-p)^{x_{i}-1}$
$l(p)=\sum [\log p + (X_{i-1} \log (1-p))]=n \log p = n \log(1-p)+ \log(1-p)\sum x_{i}$
$l^{(1)}(p)= \frac {n}{p}+ \frac {n}{1-p}- \frac {1}{1-p}\sum x_{i}= \frac {n}{p(1-p)}-\frac{1}{1-p}\sum x_{i}$
$l^{(2)}(p)= \frac {-n}{p^2}+ \frac {n}{(1-p)^2}- \frac {1}{(1-p)^2}\sum x_{i}= \frac {n}{p^2(1-p)^2}[-(1-p)^2+p^2-\bar{x}p^2]$ (b/c $\sum x_{i}=n \bar{x}$ )
Here, in order to get the asymptotic standard error of the MLE, we evaluate the 2nd derivative at the MLE, which is $\bar {X}= \frac {1}{\hat{p}}$
$\rightarrow l^{(2)}(p)= \frac {n}{\hat {p^2}(1-\hat {p})^2}[-(1-\hat{p})^2+ \hat{p}^2- \hat {p}]=\frac {-n}{\hat{p}^2(1-\hat{p})}$ $\rightarrow Var(\hat{p})= \frac {p^2(1-\hat{p})}{n}$
$\therefore$ 95% CI for p
= $\hat {p}$ $\pm$ $Z_{0.975}=\sqrt{\frac {p^2(1-\hat{p})}{n}}=0.36 \pm$ $1.96 \cdot \sqrt{\frac{(0.36)^2(1-0.36)}{136}}=(0.31, 0.41)$
= $\hat {p}$ $\pm$ $Z_{0.975}=\sqrt{\frac {p^2(1-\hat{p})}{n}}=0.36 \pm$ $1.96 \cdot \sqrt{\frac{(0.36)^2(1-0.36)}{136}}=(0.31, 0.41)$
No comments:
Post a Comment