TITLE: Maximum Likelihood Estimation with Indicator Function
QUESTION [5 upvotes]: I need to solve this exercise from the book below.
$\textbf{Mathematical Statistics, Knight (2000)}$
$\textbf{Problem 6.17}$
Suppose that $X_1,\ldots,X_n$ are i.i.d. random variables with frequency function
\begin{equation}
  f(x;\theta)=\begin{cases}
    \theta                 & \text{for $x=-1$}.\\
    (1- \theta)^2 \theta^x & \text{for $x=0,1,2,\ldots$}
  \end{cases}
\end{equation}
(a) Find the Cramer-Rao lower bound for unbiased estimators based on $X_1,\ldots,X_n$.
(b) Show that the maximum likelihood estimator of $\theta$ based on $X_1,\ldots,X_n$ is
$$\hat{\theta}_n = \frac{2 \sum_{i=1}^{n} I_{(X_{i}=-1)} + \sum_{i=1}^n X_i}{2n + \sum_{i=1}^n X_i}$$
and show that $\{\hat{\theta}_n\}$ is consistent for $\theta$.
(c) Show that $\sqrt{n}(\hat{\theta}_n-\theta)\to_d N(0,\sigma^2(\theta))$ and find the value of $\sigma^2(\theta)$. Compare $\sigma^2(\theta)$ to the Cramer-Rao lower bound in part (a).

No clue on how to solve (a) or (c).
I started to solve (b) but I can't seem to arrive at the desired solution. I'm getting this:
\begin{align}
\mathcal{L} &= \prod_{i=1}^n (1-\theta)^2 \theta^{x_i I_{(X_i \geq 0)} + I_{(X_{i}=-1)}} \\
\mathcal{L} &= (1-\theta)^{2 \sum_{i=1}^n I_{(X_i \geq 0)}} \theta^{\sum_{i=1}^n x_i I_{(X_i \geq 0)} + \sum_{i=1}^n I_{(X_{i}=-1)}} \\
\log \mathcal{L} &= 2 \sum_{i=1}^n I_{(X_i \geq 0)} \log(1-\theta) + \sum_{i=1}^n x_i I_{(X_i \geq 0)} \log \theta + \sum_{i=1}^n I_{(X_i=-1)} \log \theta
\end{align}
$\textbf{FOC}$
\begin{align}
0 &= - \frac{2 \sum_{i=1}^n I_{(X_i \geq 0)}}{1-\theta} + \frac{\sum_{i=1}^n x_i I_{(X_i \geq 0)}} \theta + \frac{\sum_{i=1}^n I_{(X_i=-1)}} \theta \\ \\
\hat{\theta}_n &= \frac{\sum_{i=1}^n I_{(X_i=-1)} + \sum_{i=1}^n x_i I_{(X_i \geq 0)}}{\sum_{i=1}^n I_{(X_i=-1)} + 2 \sum_{i=1}^n I_{(X_i \geq 0)} + \sum_{i=1}^n x_i I_{(X_i \geq 0)}}
\end{align}
which differs from the result I'm given...
Any help would be greatly appreciated.

REPLY [3 votes]: \begin{align}
L(\theta) & = \prod_{i=1}^n \theta^{I_{x_i=-1}} (1-\theta)^{2 I_{x_i\ge 0} } \theta^{x_i I_{x_i\ge 0}}. \\[10pt]
\ell(\theta) = \log L(\theta) & = (\log\theta)\sum_{i=1}^n (I_{x_i=-1} + x_i I_{x_i \ge 0} ) + 2(\log(1-\theta)) \sum_{i=1}^n I_{x_i\ge0} \\[10pt]
\ell\,'(\theta) & = \frac 1 \theta \sum_{i=1}^n (I_{x_i=-1} + x_i I_{x_i \ge 0}) - \frac 2 {1-\theta} \sum_{i=1}^n I_{x_i\ge 0} = \frac A \theta -2\frac B {1-\theta} \\[10pt]
& = 0 \text{ if and only if } A(1-\theta) - 2B\theta = 0, \\[10pt]
& \qquad \text{and that holds precisely if } A = 2B\theta+A\theta = (A+2B)\theta, \text{ so} \\[10pt]
\theta & = \frac A {A+2B} = \frac{\sum_{i=1}^n (I_{x_i=-1} + x_i I_{x_i \ge 0})}{\sum_{i=1}^n (I_{x_i=-1} + x_i I_{x_i \ge 0}) + 2\sum_{i=1}^n I_{x_i\ge 0}}.
\end{align}