\renewcommand{\coddate}{{\small \today}}
\renewcommand{\sheweek}{MT2005/2006 Exercise 8: Solutions}

\begin{enumerate}

\item
The
joint density of the two samples is
\[
f(\bx,\by;\mu_1,\mu_2)=\mu_1^{-n}\exp(-\sum
x_i/\mu_1)\, \mu_2^{-n} \exp( -\sum
y_i/\mu_2).
\]
The (unconstrained) MLEs are $\hat{\mu}_1 = \bar X$ and $\hat{\mu}_2 =
\bar Y$. Under $H_0: \mu_1=\mu_2 = \mu$, the constrained MLE is $\hat{
\mu}= (\bar X+\bar Y)/2$. Hence
\[
MLR = {f(\bX,\bY; \hat{\mu}_1, \hat{\mu_2}) \over f(\bX,\bY;
\hat{\mu}, \hat{\mu})} = {(\bar X+\bar Y)^{2n}/2^{2n} \over \bar X^n
\bar Y^n } = 2^{-2n} \{ \sqrt{\bar X/\bar Y} + \sqrt{\bar Y/\bar X}
\}^{2n}.
\]
Under $H_0$,
\[
2 \ln MLR = 4n \ln(\sqrt{\bar X/\bar Y} + \sqrt{\bar Y/\bar X
}) - 4n
\ln 2 \sim \chi^2_1
\]
approximately. We reject $H_0$ if
$2 \ln MLR > \chi^2_{1, \alpha}$,
where $\chi^2_{1, \alpha}$ denotes the upper 100$\alpha$\%
quantile of the $\chi^2_1$ distribution.


\item
For $i=1,2,3$ and 4, $X_i \sim Bin(p_i, 200)$. We need to test
\[
H_0: p_1 = p_2 = p_3 = p_4 \quad
{\rm against} \quad
H_1: p_i's \; {\rm are \; not\;  all\;  the\;  same}.
\]
The likelihood function is
\[
L(p_1, p_2, p_3, p_4)
= \prod_{i=1}^4 {200! \over x_i! (200-x_i)!}
p_i^{x_i} (1- p_i)^{200-x_i}.
\]
Unconstrained MLEs are $\hat{p}_i = x_i/200$, $1\le i\le 4$. Under
$H_0$, the constrained MLE for common $p$ is $\hat{p} = \sum_{i=1}^4
x_i / (4\times 200) $. Hence
\[
MLR = {L(\hat{p}_1, \hat{p}_2, \hat{p}_3, \hat{p}_4) \over L(\hat{p},
\hat{p}, \hat{p}, \hat{p})} =
 {\prod_{i=1}^4 \hat{p}_i^{x_i} (1- \hat{p}_i) ^{200-x_i}
\over \hat{p}^{\sum_i x_i} (1-\hat{p})^{800-\sum_i x_i}}.
\]
\[
2\ln MLR
=
 \sum_{i=1}^4 \{ x_i \ln \hat{p}_i + (200-x_i) \ln (1-\hat{p}_i) \}
- \sum_i x_i \, \ln \hat{p} + (800-\sum_i x_i) \ln(1-\hat{p}),
\]
which is approximately $\chi^2_3$ under $H_0$.
(To see the degree of freedom, let $p_i= p_1+ \delta_i$ for $i=2, 3, 4$.
Then the null hypothesis is $H_0: \delta_1 = \delta_2 = \delta_3=0$.)
We reject $H_0$ if $2\ln MLR > \chi^2_{3, \alpha}$, where $\chi^2_{3, \alpha}$
is the upper $100\alpha$\% quantile of $\chi^2_3 $ distribution.


For the given data, $2\ln MLR=153.96> \chi^2_{3, 0.05} = 7.815$. Hence we reject
$H_0$ and conclude that there exists significant difference among the four areas.


\item
Note $\sum_{i=1}^{10}(X_i -\bar X)^2/\sigma^2 \sim \chi^2_9$.
Leaving out 5\% at both ends of the distribution, we have
\begin{eqnarray*}
0.9&=&
P\{ 3.325 < \sum_{i=1}^{10}(X_i -\bar X)^2/\sigma^2 < 16.92\}\\
&=&
 P\{ \sum_{i=1}^{10}(X_i- \bar X)^2/16.92< \sigma^2 < \sum_{i=1}^{10}(X_i -\bar X)^2
/3.325\},
\end{eqnarray*}
namely, $a_1 = 16.92$ and $a_2 = 3.325$.

Similarly since $\sum_{i=1}^{10}(X_i -\mu)^2/\sigma^2 \sim \chi^2_{10}$, we
have
\begin{eqnarray*}
0.9 &=&
P\{ 3.94 < \sum_{i=1}^{10}(X_i -\bar X)^2/\sigma^2 < 18.31\}\\
&=&  P\{ \sum_{i=1}^{10}(X_i- \mu)^2/18.31< \sigma^2 < \sum_{i=1}^{10}(X_i -\mu)^2
/3.94\},
\end{eqnarray*}
namely, $b_1 = 18.31$ and $b_2 = 3.94$.

The average lengths of the confidence intervals are
\[
(a_2^{-1} - a^{-1}_1) E\{ \sum_{i=1}^{10} (X_i -\bar X)^2\}
= (a_2^{-1} - a^{-1}_1) \times 9 \sigma^2 = 2.18 \sigma^2,
\]
\[
(b_2^{-1} - b^{-1}_1) E\{ \sum_{i=1}^{10} (X_i -\mu)^2\}
= (b_2^{-1} - b^{-1}_1) \times 10 \sigma^2 = 1.99 \sigma^2.
\]
The second interval is shorter since it makes use of given mean $\mu$.

\item
The MLE for $\theta$ is $X_{(n)}$, the sample maximum. It is easy to see that
for $x \in [0, 1]$,
\[
P\{ X_{(n)} /\theta < x \}
= P \{ X_i/\theta < x \mbox{ for all } 1\le i \le n\} =
\big[ P \{ X_1/\theta < x \}\big]^n = x^n.
\]
Hence $X_{(n)} /\theta$ is a pivot with probability
$f(x) = n x^{n-1}$ for $0\le x \le 1$.
To find a $100(1-\alpha)\%$ confidence interval
for $\theta$, we need to find $a$ and $b$ such that
\[
P \{ a \le X_{(n)} /\theta \le b\} = 1 -\alpha.
\]
Obviously there are many choices for $a$ and $b$ here. However we prefer the interval
which has the shortest length. Therefore
we look for an interval on which the probability density
$f(x)$
is as large as possible.
Hence we should let $b=1$ and choose $a$ according to $\alpha$. This yields
$a = \alpha^{1/n}$. The resulting confidence interval for $\theta$ is
\[
[X_{(n)} /b, \;  X_{(n)}/a] = [X_{(n)}, \;  X_{(n)}  \alpha^{-1/n} ].
\]


\end{enumerate}
