\documentclass[11pt]{article}
\usepackage{amsmath,amssymb}
%\renewcommand{\baselinestretch}{1.1}
\setlength{\topmargin}{-1cm} \setlength{\textheight}{23.5cm}
\setlength{\textwidth}{16cm} \setlength{\oddsidemargin}{-0.5cm}
\setlength{\evensidemargin}{-0.5cm} \setlength{\unitlength}{0.8cm}

\renewcommand{\baselinestretch}{1.2}
\setlength{\parindent}{0pt} \setlength{\parskip}{11pt}

% \pagestyle{empty}

%\input{../aliases}

\newcommand{\eps}{\varepsilon}
\newcommand{\var}{{\rm Var}}
\newcommand{\cov}{{\rm Cov}}
\newcommand{\corr}{{\rm Corr}}
\newcommand{\nid}{{\rm NID}}
\newcommand{\iid}{{\rm IID}}
\newcommand{\norm}{{\rm N}}
\newcommand{\wn}{{\rm WN}}
\newcommand{\mse}{{\rm MSE}}
\newcommand{\diag}{{\rm diag}}
\newcommand{\pois}{{\rm Pois}}
\newcommand{\bin}{{\rm Bin}}
\newcommand{\Exp}{{\rm Exp}}
\newcommand{\Gam}{{\rm Gamma}}
\newcommand{\dd}[2]{\frac{\partial #1}{\partial #2}}

\begin{document}
\begin{center}
{\large \bf  ST402 PMSP \\ Exam Solutions 2004}\\
\end{center}

\begin{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%
% QUE 1
\item
\begin{enumerate}
\item $f_{X,Y}$ is a positive real valued function. \newline
$\int_{-\infty}^\infty \int_{-\infty}^\infty f_{X,Y}(x,y) dy dx
= \int_0^\infty \int_x^\infty \lambda(\theta+\lambda) e^{-\theta x -\lambda y} dy dx \newline
= \int_0^\infty (\theta+\lambda) e^{-(\theta+\lambda)x} dx = [-e^{-(\theta+\lambda)x}]_0^\infty
= 0-(-1) = 1$ \newline
$\Rightarrow f_{X,Y}$ is a density.

\item $f_X(x) = \int_{-\infty}^\infty f_{X,Y}(x,y) dy = (\theta+\lambda) e^{-(\theta+\lambda)x}$
for $0<x<\infty \Rightarrow X \sim \Exp(\theta+\lambda)$ \newline
$f_{Y|X}(y|x)  = \frac{f_{X,Y}(x,y)}{f_X(x)}
= \left\{\begin{array}{ll} \lambda e^{-\lambda (y-x)}, & x<y<\infty, \\
0, & \text{otherwise}. \end{array}\right.$ \newline
$E(Y|X=x) = \int_x^\infty y \lambda e^{-\lambda (y-x)} \quad [\text{let } z=y-x \Rightarrow dz = dy] \newline
= \int_0^\infty \lambda (z+x) e^{-\lambda z} dz = \frac{1}{\lambda} + x$ \newline
$\Rightarrow E(Y|X) = \frac{1}{\lambda} + X$ \newline
$E(X) = \frac{1}{\theta+\lambda}$ and
$E(Y) = E(E(Y|X)) = \frac{2\lambda + \theta}{\lambda(\lambda + \theta)}$ \newline
$E(XY) = E(E(XY|X)) = E(XE(Y|X)) \newline
= \frac{1}{\lambda} E(X) + E(X^2) = \frac{1}{\lambda} E(X) +\var(X) + E(X)^2$ \newline
$= \frac{1}{\lambda}.\frac{1}{\lambda + \theta} + \frac{1}{(\lambda+\theta)^2}
+ \frac{1}{(\lambda+\theta)^2} = \frac{3 \lambda+\theta}{\lambda(\lambda+\theta)^2}$ \newline
$\cov(X,Y) = E(XY) - E(X)E(Y) = \frac{1}{(\lambda + \theta)^2}$

\item $M_X(t) = E(e^{tX}) = \int_{-\infty}^\infty e^{tx} f_X(x) dx$ \newline
$= \int_0^{\infty} e^{tx} (\theta+\lambda) e^{-(\theta+\lambda)x} dx
= \frac{(\theta+\lambda)}{(\theta+\lambda) - t}$ \newline
$M_{Y|X}(t|x) = E(e^{tY}|X=x) = \int_{-\infty}^\infty e^{ty} f_{Y|X}(y|x) dy$ \newline
$=\int_0^\infty e^{ty} \lambda e^{-\lambda(y-x)} dy
= \lambda e^{\lambda x} [\frac{1}{t-\lambda} e^{(t-\lambda)y}]_x^{\infty}
= \frac{\lambda}{\lambda-t} e^{tx}$ provided $|t| < \lambda$ \newline
$\Rightarrow M_{Y|X}(t|X) = \frac{\lambda}{\lambda-t} e^{tX}$ \newline
$M_Y(t) = E(M_{Y|X}(t|X)) = \frac{\lambda}{\lambda-t} M_X(t)
= \frac{\lambda}{\lambda-t} \frac{(\theta+\lambda)}{(\theta+\lambda) - t}$ \newline
$\Rightarrow M_Y(t) = M_W(t) M_X(t)$ where $M_W(t) = \frac{\lambda}{\lambda-t}$ is the moment
generating function of $\Exp(\lambda)$. Thus, by uniqueness of MGF, $Y = W + X$
where $W$ and $X$ are independent exponentially distributed
random variables.

\item $Z = X + Y = W + 2X$ where $X$ and $W$ are independent. \newline
$M_Z(t) = E(e^{tZ}) = E(e^{tW}) E(e^{t2X})$ (by independence) \newline
$ = M_W(t) M_X(2t) = (1-\frac{t}{\lambda})^{-1} (1-\frac{2t}{\theta+\lambda})^{-1}$ \newline
$K_Z(t) = \log M_Z(t) = -\log (1+(-\frac{t}{\lambda})) -\log(1+(-\frac{2t}{\theta+\lambda}))$ \newline
$=\frac{t}{\lambda} + \frac12.\left(\frac{t}{\lambda}\right)^2 + \dots + \frac{2t}{\theta+\lambda}
+ \frac12.\left(\frac{2t}{\theta+\lambda}\right)^2+\dots
= (\frac{1}{\lambda} + \frac{2}{\theta+\lambda})t +
(\left(\frac{t}{\lambda}\right)^2 + \left(\frac{2t}{\theta+\lambda}\right)^2) \frac{t^2}{2} + \dots$
Coefficient of $t^r$ is
$(\left(\frac{t}{\lambda}\right)^r + \left(\frac{2t}{\theta+\lambda}\right)^r) \frac{1}{r}$ \newline
$\Rightarrow r^{\rm th} \text{ cumulant: } \kappa_r =
(\left(\frac{t}{\lambda}\right)^r + \left(\frac{2t}{\theta+\lambda}\right)^r) (r-1)!$
\end{enumerate}

\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%
% QUE 2
\item
\begin{enumerate}
\item Inverse transformation is $x(u,v)=uv$ and $y(u,v)=v$. \newline
$\Rightarrow |J(u,v)| = |\dd{x}{u} \dd{y}{v} - \dd{x}{v} \dd{y}{u}| = |v|$
Substituting in equation (1) yields $f_{U,V}(u,v) = f_{X,Y}(uv,v)|v|$ as required.

\item
\begin{enumerate}
\item $f_X(x) = \frac{1}{\sqrt{2 \pi}} \exp (-\frac12 x^2)$ and
$f_Y(y) = \frac{1}{\sqrt{2 \pi}} \exp (-\frac12 y^2)$ \newline
Using independence $f_{X,Y}(x,y) = f_X(x) f_Y(y)
= \frac{1}{2 \pi} \exp(-\frac12 (x^2 + y^2))$ \newline
$\Rightarrow f_{U,V}(u,v) = \frac{1}{2 \pi} \exp(-\frac12(u^2v^2 + v^2))|v|$ \newline
$\Rightarrow f_U(u) = \int_{-\infty}^\infty f_{U,V}(u,v) dv
= \int_{-\infty}^\infty \frac{1}{2 \pi} \exp\{-\frac12(1+u^2)v^2\}|v| dv$ \newline
$=\frac{1}{2 \pi} \left( \int_0^\infty v \exp\{\}dv - \int_{-\infty}^0 v \exp\{\} \right)
= \frac{1}{2 \pi} \left( [-\frac{1}{1+u^2} \exp\{\}]_0^\infty  - [-\frac{1}{1+u^2} \exp\{\}]_{-\infty}^0 \right)$ \newline
$= \frac{1}{\pi}.\frac{1}{1+u^2}$ where $-\infty<u<\infty$.\newline
Thus the mean of the ratio of standard normals is not finite.

\item Let $Z = |Y|$ then $F_Z(z) = P(|Y| \leq z) = P(-z \leq Y \leq z) = F_Y(z) - F_Y(-z)$. \newline
$\Rightarrow f_Z(z) = \frac{d}{dz} F_Z(z) = f_y(z) + f_y(-z)$ for $z>0$. \newline
When $Y$ is a standard normal \newline
$f_Z(z) = \left\{\begin{array}{ll} \sqrt{\frac{2}{\pi}} \exp(-\frac12 z^2), & z>0, \\
0, & \text{otherwise}. \end{array}\right.$

\item By independence $f_{X,Z}(x,z) = \frac{1}{\pi} \exp(-\frac12(x^2+z^2))$
for $-\infty < x < \infty$, $0 < z < \infty$ \newline
$\Rightarrow f_{U,V}(u,v) = \frac{1}{\pi} \exp(-\frac12(u^2v^2 + v^2)) |v|$ where $v>0$ \newline
$\Rightarrow f_U(u) = \frac{1}{\pi} \int_0^\infty v \exp\{-\frac12(u^2v^2 + v^2)\} dv$ \newline
$=[-\frac{1}{\pi}.\frac{1}{1+u^2} \exp\{\}]_0^{\infty} = \frac{1}{\pi}.\frac{1}{1+u^2}$
for $-\infty < u < \infty$.
\end{enumerate}

\end{enumerate}


%%%%%%%%%%%%%%%%%%%%%%%%%%
% QUE 3
\item
\begin{enumerate}
\item
\begin{enumerate}
\item
The log-likelihood for $\lambda$ is $l(\lambda) = n \bar X \log \lambda  - n
\lambda +C $, where $\bar X = n^{-1} \sum_{1\le i\le n} X_i$, and
 $C$ is a constant independent of $\lambda$. Let
$\dot l(\lambda) = 0$, we have the MLE (for $\lambda$) $\hat \lambda = \bar X$.
Hence the MLE for $\theta$ is $\hat \theta = \big( \hat \lambda)^2 =
(\bar X)^2$.
\item
$E (\bar X^2) = n^{-2} E( \sum_i X_i^2 + \sum_{i\ne j} X_i X_j)
= n^{-1} E( X_1^2) +  (1- n^{-1}) E(X_1 X_2) = n^{-1} E( X_1^2)+ (1-
n^{-1}) \theta$.
Note $E( X_1^2) = E\{ X_1 (X_1-1) \} + \lambda$, and
\[
E\{X_1 (X_1 -1 )\} = \sum_{j=0}^\infty j(j-1) {\lambda^j\over j!} e^{-\lambda}= \lambda^2 \sum_{j=2}^\infty { \lambda^{j-2} \over (j-2)!} e^{-\lambda}
= \lambda^2.
\]
Hence $E (\bar X^2) =n^{-1}( \lambda^2 + \lambda) + (1-
n^{-1}) \theta
= \theta + \lambda/n$. Therefore, the bias is $ E(\hat \theta) - \theta = \lambda/n$.
\end{enumerate}


\item
\begin{enumerate}
\item (Course work)
\item $E (\tilde \theta - \theta)^2 = E (\tilde \theta - E \tilde \theta
+ E \tilde \theta - \theta)^2 =
 E (\tilde \theta - E \tilde \theta)^2 + (E \tilde \theta - \theta)^2
+ 2 (E \tilde \theta - \theta) E (\tilde \theta - E \tilde \theta)
= \mbox{Var}(\tilde \theta) + (E \tilde \theta - \theta)^2$.
\item
Since $T$ is sufficient, the conditional distribution of the whole sample
given $T$ is independent of $\theta$. Therefore $\hat \theta = E(\tilde
\theta |T)$
is a function of $T$ only and does not depend on $\theta$, hence a statistic.

Since $E(\hat \theta) = E(\tilde \theta )$, the biases of the two estimator
are the same. We only need to show that Var$(\tilde \theta ) \ge
\mbox{Var}(\hat \theta)$, which is implied by $E(\tilde \theta^2) \ge
E(\hat \theta^2)$, namely $
E ( \tilde \theta ^2) -
E [ \{ E(\tilde \theta|T) \}^2 ] \ge 0,
$
which is implied by
\[
E (\tilde \theta ^2|T) -
 \{ E(\tilde \theta|T) \}^2 = \mbox{Var} ( \tilde \theta |T) \ge 0.
\]
\end{enumerate}
\end{enumerate}

\item
\begin{enumerate}
\item
$l(\theta) = n \log \theta - n \theta \bar X$, where $\bar X = n^{-1} \sum_{1
\le i \le n} X_i$. Let $\dot l(\theta)=0$, leading to the MLE $\hat \theta = 1/\bar X$.

\item
$M_{X_1}(t) = \int_0^\infty e^{tx} \theta e^{-\theta x} dx
= \theta \int_0^\infty e^{- (\theta -t) x} dx = {\theta \over \theta -t}
= (1 - t/\theta)^{-1}$ for $t< \theta$.

\item
$M_T(t) = E [\exp \{ 2 \theta (X_1 + \cdots X_n) t\} ]
= \prod_{j=1}^n E [\exp \{ 2t \theta X_j\}]
= \{ M_{X_1} ( 2t\theta)\}^n = (1-2t)^{-n}$.
Hence $T\sim \chi^2_{2n}$ which does not depend on anything
unknown, i.e. $Y$ is pivotal.

\item
Let $P(a < T < b) = 0.95$, then for any $\theta>0$
\begin{equation} \label{pivotal}
P_\theta \{ a/(2 Y ) < \theta < b/(2 Y ) \}
=0.95.
\end{equation}
When $n=10$, $T \sim \chi^2_{20}$. We may let $a, b$ be, respectively,
 the 2.5\% and 97.5\% quantiles of the $\chi^2_{20}$-distribution, namely
$a= 9.59$ and $b=34.17$. With $Y=19.4$, this leads to the confidence interval
$(a/(2 Y) , \; b/(2 Y ))= (0.25, 0.88)$.

For testing hypothesis $H_0: \; \theta = \theta_0$, it follows (\ref{pivotal})
that
\[
P_{\theta_0} \{ a/(2 Y )\ge \theta_0, \;
\mbox{or} \;  b/(2 Y ) \le \theta_0 \} = 0.05.
\]
Since $b/(2 Y ) =0.88 \le \theta_0=2$, we reject the null hypothesis $\theta = 2$.



\item
Note $P(X_j > u_j) = e^{-\theta u_j}$, and
$\tilde X_j(\theta) \equiv E_\theta (X_j | X_j > u_j) = 1/\theta + u_j$.
The E-step is
\begin{eqnarray*}
Q(\theta) &=& E_{\theta_0} \{ l(\theta) | Y_j > u_j, \; j=m+1, \cdots, n\}
= n \log \theta - \theta  \sum_{i=1}^m X_i
- \theta  \sum_{j=m+1}^n \tilde X_j(\theta_0)\\
&=& n \log \theta - \theta  \sum_{i=1}^m X_i - \theta \{ (n-m) /\theta_0
+\sum_{j=m}^n u_j \}.
\end{eqnarray*}
The M-step is simply to maximise $Q(\theta)$, leading to
\begin{equation} \label{EM}
\theta_1 = n /\big\{ \sum_{i=1}^m X_i  +\sum_{j=m}^n u_j + (n-m) /\theta_0
\}.
\end{equation}
Specify an initial value at, for example,
$\theta_0 = m\big/ \sum_{i=1}^m X_i$,
the EM-algorithm now iterates (\ref{EM})
(with $\theta _0$ equal to
$\theta _1$ from the previous iteration),
until the two successive
values for $\theta _1$ smaller than a prescribed small quantity.
The terminal value of $\theta _1$ is taken as the estimate for $\theta$.


\end{enumerate}

\end{enumerate}
\end{document}
