I'm working on the following problem:
Let a single observation $X$ be normal, $X \sim N(\sqrt\theta), 1)$ , $\theta \geq 0$. Find the maximum likelihood estimator $\hat{\theta}(X)$ of $\theta$ (note that it is not $X^2$ for all $X$).
However, when I work out the MLE, unfortunately, I do get that the MLE $\hat{\theta}(X)$ of $\theta$ is given by $\hat{\theta}(X) = X^2$. Here is my work:
$f(X | \sqrt\theta) = \frac{1}{\sqrt{2 \pi}}e^{-\frac{(X-\sqrt{\theta})^2}{2}}$
$\Rightarrow$ $loglik(\sqrt{\theta}) = ln(\frac{1}{\sqrt{2 \pi}}) - \frac{(X-\sqrt{\theta})^2}{2}$
$\Rightarrow$ $\frac{d}{d\theta}loglik(\sqrt{\theta}) = -(X-\sqrt{\theta})^2 \cdot \frac{-1}{2\sqrt{\theta}}$.
$\Rightarrow$ Setting $\frac{d}{d\theta}loglik(\sqrt{\theta}) = 0$, we have $-(X-\sqrt{\theta})^2 = 0$ , giving MLE $X$ of $\sqrt{\theta}$
$\Rightarrow$ the MLE of $\theta = \sqrt{\theta}^2$ is given by $\hat{\theta}(X) = X^2$ for all $X$ and $\theta \geq 0$.
Where did I make a misstep in my logic ?
Thanks!
Just to get this off the unanswered list...
Your answer for the (unrestricted) MLE is correct.
But here since the parameter space is restricted to $[0,\infty)$, the restricted MLE of $\sqrt\theta$ is $X$ if $X\ge 0$ and it takes the boundary point $0$ if $X<0$. By invariance property, MLE of $\theta$ is thus
$$\hat\theta(X)=\begin{cases}X^2&,\text{ if }X\ge 0 \\ 0 &,\text{ if }X<0\end{cases}\,\,=X^2 I_{X\ge 0}$$