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

\begin{enumerate}

\item
The log-likelihood function is
$l(\theta) = -\sum_{1\le j \le n} \log \{ 1 + (X_j - \theta)^2\}
- n \log \pi$. Let $\dot l(\theta) =0$, leading to the equation
that the MLE must satisfy:
\begin{equation}\label{3-1}
s(\hat{\theta}) = \sum_{1\le j \le n} { \frac{2 (X_j - \hat{\theta})}{1
+ (X_j - \hat{\theta})^2} } = 0.
\end{equation}
Note
\[
\dot s(\theta) \equiv {\frac{\partial}{\partial \theta}} s(\theta) =
-2 \sum_{j=1}^n { \frac{1 - (X_j - \theta)^2}{\{ 1 + (X_j -
\hat{\theta})^2\}^2}}.
\]
Hence the Newton-Raphson iteration is defined as
\[
\hat{\theta}_{k+1} = \hat{\theta}_k - s(\hat{\theta}_k)/\dot
s(\hat{\theta}_k), \quad \quad k =1, 2, \cdots.
\]

Note that the score function $s(\theta)$ is not monotone in $\theta$.
Hence (\ref{3-1}) may have more than one solutions. We should start
the above Newton-Raphson iteration with a good initial value.
Since the density $f(\cdot, \theta)$ is symmetric around $\theta$, it
makes sense to consider either the sample mean or sample median as an
initial estimate. However $E(X_1)$ is not well-defined, so the sample
mean may not be a good estimator $\theta$. Thus we may use the sample
median as the initial value for our algorithm.

\item
Note that $P(u_j \le X_j \le v_j) = e^{-\lambda u_j } - e^{-\lambda v_j}$,
 and $f_{X_j} (x| u_j \le X_j \le v_j ) = \lambda e^{-\lambda x} /
\{ e^{-\lambda u_j} - e^{-\lambda v_j} \}.$ Hence,
\[
\tilde{X}_j(\lambda) \equiv E_\lambda ( X_j | X_j \in [u_j , v_j] ) =
\frac{1}{\lambda} + \frac{ u_j \exp(- \lambda u_j) - v_j \exp( -
\lambda v_j)}{\exp(- \lambda u_j) - \exp( - \lambda v_j) }.
\]

The log-likelihood function based on the full sample is
\[
l(\theta) \equiv  l(\theta; X_1, \cdots, X_n) = n\log \lambda - \lambda \sum_
{j=1}^n X_j,
\]
which yields the MLE based on full sample $\hat{\theta}(X_1, \cdots,
X_n) = n/ \sum_{1\le j \le n} X_j$.

Now  the E-step is
\[
Q(\lambda) = E_{\lambda_0} \{ l(\theta) \, | \, Y_j \in [u_j, v_j] \;
{\rm for} \; m< j \le n\} = n\log \lambda - \lambda \sum_ {i=1}^m X_i -
\lambda \sum_{j=m+1}^n \tilde{X}_j(\lambda_0),
\]
and the M-step is simply
\[
\lambda_1 = n \big / \big\{ \sum_{i=1}^m X_i + \sum_{j=m+1}^n
\tilde{X}_j(\lambda_0) \big\}.
\]
The EM-algorithm iterates E-step and M-step with, for example, initial value
$\lambda_0 = m/(X_1 + \cdots +X_m)$.

\item
(a) Note $l(p) = X \log p + (n-X) \log (1-p)$,
$s(p) = X/p - (n-X)/(1-p)$, and $\dot s(p) = -X/p^2 - (n-X) /(1-p)^2$.
Hence the Fisher information is
\[
{\cal I}(p) = - E_p\{ \dot s(p) \} = n/p + n/(1-p) = n/\{ p (1-p) \}.
\]
The C-R lower bound for the variance of unbiased estimator of $\theta(
= p^2)$ is $(\frac{d \theta}{d p})^2/{\cal I}(p) = 4 p^3 (1-p)/n$.

(b) Note $L(p) = \prod_{j=1}^n p^{X_j} (1-p)^{1-X_j}$. This yields
$\hat{p} = X /n$, where $X= \sum_{j=1}^n X_j$. Hence $\hat{\theta} = (
\hat{p})^2 = X^2/n^2$.

(c) Note
\[
 E_p(X^2) = \sum_{i=1}^{ n} E_p(X_i^2)
+ \sum_{1\le i\ne j \le n} E_p(X_i X_j)
= n E_p(X_1^2) + (n^2 -n) E_p(X_1 X_2)
= n p + (n^2 -n) p^2.
\]
Hence $E_p (\hat{\theta} ) = p^2 + p(1-p)/n\ne p^2$, i.e $\hat{\theta}
$ is a biased estimator for $\theta$ with bias $p(1-p)/n$.

(d) We draw bootstrap sample $X_1^*, \cdots, X_n^*$ from Bernoulli
distribution with probability $\hat{p}$. Define the bootstrap estimator
$\hat{\theta}^* = (X_1^* + \cdots + X_n^*)^2/n^2$. The bootstrap
estimator for the bias of $\hat{\theta}$ is ${\rm Bias}^* \equiv
E_{\hat{p}} (\hat{\theta}^*) - \hat{\theta}$. In practice, $
E_{\hat{p}} (\hat{\theta}^*)$ may be estimated via repeated bootstrap
samplings.

{\small {\bf Note}. For this simple example, the bias estimator admits
a simple analytic formula ${\rm Bias}^* = \hat{p} (1 - \hat{p})/n$,
which is the simple plug-in estimator.}

\item
Since both Null and Alternative Hypotheses are completely
specified,  by the Neyman-Pearson Lemma, with a sample
$\bx=(x_1,x_2,\dots ,x_n)$, the most powerful test will reject $H_0$
for large values of
\[
LR=\frac{f_{\bX}(\bx;\theta_2)}{f_{\bX}(\bx;\theta_1)}.
\]
Now,
\[
LR=\frac{\frac{1}{\left(\sqrt{2\pi\theta_2}\right)^n}\exp\left[-\frac{1}{2}\sum_{i=1}^nx_i^2/\theta_2\right]}
{\frac{1}{\left(\sqrt{2\pi\theta_1}\right)^n}\exp\left[-\frac{1}{2}\sum_{i=1}^nx_i^2/\theta_1\right]}
\]
which reduces to
\[
LR=\left(\sqrt{\theta_1/\theta_2}\right)^n\exp\left[-\frac{1}{2}\sum_{i=1}^nx_i^2/(1/\theta_2-1/\theta_1)\right].
\]
Obviously, this rejects $H_0$ for small values of
\[
\frac{1}{2}\sum_{i=1}^nx_i^2/(1/\theta_2-1/\theta_1).
\]
So, if $\theta_1>\theta_2$, the most powerful test rejects $H_0$
for small values of $\sum x_i^2$.  If, on the other hand,
$\theta_1<\theta_2$, the most powerful test rejects  $H_0$  for
large values of $\sum x_i^2$.

The critical value depends on the distribution under $H_0$.
For $n=10$,
$T=\sum X_i^2  \sim \chi^2_{10}$ under $H_0: \theta=\theta_1 =1$. To test against
$H_1: \theta= \theta_2 =2$, we reject $H_0$ iff
\[
T>\chi^2_{10, \alpha} = 18.30 \quad {\rm for} \; \alpha=0.05,
\]
where $\chi^2_{n,\alpha}$ is the upper $100\alpha$\% point of
the $\chi^2$ distribution with $n$ degrees-of-freedom.
The power is
\[
P\{ T> 18.30 | \theta=2\} = P\{ T/2 > 9.15\}
= P\{ \chi^2_{10} > 9.15\} =0.518.
\]

\item
Let $\sigma^2_1> \sigma^2_0$. For simple hypotheses $H_0:\, \sigma^2 = \sigma^2_0$
against $H_1:\, \sigma^2 = \sigma_1^2$, the MPT is defined in terms of
the likelihood ratio statistic
\[
\mbox{LR} = \frac{ \sigma_1 ^{-n} \exp\{ - \frac{1}{2 \sigma^2_1 }
\sum_i X_i^2\}}{\sigma_0  ^{-n} \exp\{ - \frac{1}{2 \sigma^2_0 }\sum_i
X_i^2 \} } = (\sigma_0 /\sigma_1)^n \exp\left\{ \frac{1}{2} (
\frac{1}{\sigma^2_0 } - \frac{1 }{\sigma^2_1} ) \sum_i X_i^2 \right\}.
\]
Therefore LR$>K$ is equivalent to $\sum_i X_i^2>K_1$. Let
\[
P_{\sigma_0^2} \left\{ \sum_{i=1}^n X_i^2 > K_1 \right\} =
P_{\sigma_0^2} \left\{  \frac{1}{\sigma^2_0 } \sum_{i=1}^n X_i^2
>K_1/ \sigma^2_0 \right\} \equiv \alpha,
\]
Hence $K_1 = \sigma^2_0 \chi^2_{n, \alpha}$, where $\chi^2_{n, \alpha}$ is the upper
$\alpha$-point of $\chi^2$-distribution with $n$ degrees of freedom. Note this test does
not depend on $\sigma_1^2$, and is therefore the MPT for any $\sigma_1^2> \sigma_0^2$.
On the other hand, for any $\sigma^2< \sigma_0^2$,
\[
P_{\sigma^2} \left\{ \sum_{i=1}^n X_i^2 >\sigma^2_0 \chi^2_{n, \alpha}
\right\} = P_{\sigma^2} \left\{ \frac{1}{\sigma^2} \sum_{i=1}^n X_i^2
> \frac{\sigma^2_0}{\sigma^2} \chi^2_{n, \alpha} \right\} \le
P_{\sigma^2} \left\{ \frac{1}{\sigma^2} \sum_{i=1}^n X_i^2 > \chi^2_{n,
\alpha} \right\} = \alpha.
\]
Hence it is the desired UMPT.



\end{enumerate}
