\documentclass{article}

\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\topmargin}{0.0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textwidth}{7.0in}
\setlength{\textheight}{9.5in}
\setlength{\parindent}{0in}
\setlength{\parskip}{0.05in}
\setlength{\columnseprule}{0.3pt}
\usepackage{fancyvrb}
\usepackage{relsize}
\usepackage{hyperref}

\begin{document}

Name: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Directions: {\bf Work only on this sheet} (on both sides, if needed); do not
turn in any supplementary sheets of paper. There is actually plenty of room
for your answers, as long as you organize yourself BEFORE starting writing.

{\bf \Large SHOW YOUR WORK!} 

{\bf 1.} Suppose that the conditional distribution of Y given X (the
latter a scalar, i.e. we have just one predictor) is Poisson with
parameter $\beta_1 X$.  We wish to estimate $\beta_1$ from our data,
$(X_1,Y_1),...,(X_n,Y_n)$, with the n pairs being assumed
to be i.i.d. 

\begin{itemize}

\item [(a)] (25) Find the conditional Maximum Likelihood estimator of
$\beta_1$.  (There is a closed-form solution.)

\item [(b)] (25) Give formulas for unconditional and conditional
approximate 95\% confidence intervals for $\beta_1$.  {\bf Justify your
answers!}

\end{itemize}

{\bf 2.} (50) Consider the linear regression model in Chapter 9, but
with the following change.  Instead of the homogeneous-variance model
(9.32), suppose that

\begin{equation}
\label{samevar}
Var(Y_i | X_i) = \sigma_i^2
\end{equation}

where the $\sigma_2^2$ are \underline{known} positive quantities.  

In that case, (9.25) is still a reasonable estimator---it will still be
consistent, for instance---but (9.38) would be invalid and thus not
usable for confidence intervals and significance tests.  Moreover,
(9.25) has certain optimality properties,\footnote{Minimum variance among
all unbiased estimators.} so it would be good to find a way to still use
(9.25) in this heterogeneous-variance setting.

Toward that end, you will transform the original problem into a new one
that satisfies (9.25).  Do this by finding a constant matrix A such that
the new random vector W = AV satisfies the condition (9.32).  Then use
(9.25) on W, eventually transforming back so that we have an optimal
estimator $\hat{\beta}$ of $\beta$ of the original problem, complete
with covariance matrix for that $\hat{\beta}$.  Remember, all your final
quantities will have the $\sigma_i$ in them, but that's all right
because they are assumed known.

Note:  Matrix quantities must be simplified to the extent possible.

{\bf Solution:}  

{\bf 1.}  The (conditional) likelihood function is

\begin{equation}
L = \Pi_{i=1}^n 
\left [
\frac
{e^{-\beta_1 X_i} (\beta_1 X_i)^{Y_i!}}
{Y_i!}
\right ]
\end{equation}

So set

\begin{equation}
l = \ln(L) = \sum_{i=1}^n 
\left [
-\beta_1 X_i + Y_i (\ln(\beta_1) + \ln(X_i) - \ln(Y_i))
\right ]
\end{equation}

Then setting $0 = \frac{dl}{d\beta_1}$ and solving, we get

\begin{equation}
\label{beta1hat}
\hat{\beta}_1 = \frac{\hat{Y}}{\hat{X}}
\end{equation}

For constructing the unconditional confidence interval for  $\beta_1$,
we know from the application of Slutsky's Theorem in Section 7.4.3
that we can treat as a constant.  Our confidence interval is then

\begin{equation}
\frac{\hat{Y}}{\hat{X}} \pm 1.96 \frac{s_Y}{\bar{X}}
\end{equation}

$s_Y^2$ is the sample variance of the $Y_i$.

For the conditional confidence, note that by the Poisson property,

\begin{equation}
Var(Y_i|X_i) = E(Y_i|X_i) = \beta_1 X_i
\end{equation}

Then

\begin{eqnarray}
Var(\bar{Y}|\textrm{ the }X_i) 
&=& Var \left (\frac{Y_1+...+Y_n}{n} \right | X_i) \\
&=& \frac{1}{n^2} \sum_{i=1}^n Var(Y_i|X_i) \\
&=& \frac{1}{n^2} \sum_{i=1}^n \beta_1 X_i \\
&=& \beta_1 \bar{X} / n
\end{eqnarray}

So from (\ref{beta1hat}) we have

\begin{equation}
Var(\hat{\beta_1} | \textrm{ the }X_i) 
= \frac{1}{\bar{X}^2} Var(\bar{Y}|\textrm{ the }X_i) 
= \beta_1 / (n \bar{X})
\end{equation}

The conditional standard error of $\hat{\beta_1}$ is then

\begin{equation}
\sqrt
{
\hat{\beta_1} / (n \bar{X})
}
= \sqrt
{
\bar{Y} / (n \bar{X}^2)
}
\end{equation}

{\bf 2.}  Set A to be the diagonal matrix whose i$^{th}$ element is
$1/\sigma_i$.  Then 

\begin{equation}
Cov(W) = I
\end{equation}

That means that (9.32) is satisified, with $\sigma^2 = 1$.  (Note that
the $\sigma_i$ are KNOWN.  It was wrong to answer that A would have as
its i$^{th}$ element $1/\sigma_i$, as that would introduce a new
quantity, $\sigma^2$ that is not part of the problem.)

Let $\gamma$ denote the vector of population coefficients for the
regression function of W on Q.  (9.32) gives us

\begin{equation}
\hat{\gamma} = (q'q)^{-1} q'w
\end{equation}

Now to get back to the original setting with V instead of W, note
that since W = AV, we have

\begin{equation}
\gamma = E(W|Q) = A E(V|Q) = A \beta
\end{equation}

Thus we set

\begin{equation}
\hat{\beta} = A^{-1} \hat{\gamma} 
\end{equation}

so

\begin{equation}
\hat{\beta} = A^{-1} (Q'Q)^{-1} Q'W = A^{-1} (Q'Q)^{-1} Q'AV
\end{equation}

Writing that last quantity as RV, we have

\begin{equation}
Cov(\hat{\beta}) = R Cov(V) R' = R (A^{-1})^2 R'
\end{equation}

Lots of stuff cancels in that last expression, and eventually we get

\begin{equation}
Cov(\hat{\beta}) = A^{-1} (Q'Q)^{-1} A^{-1}
\end{equation}

\end{document} 
