Finding MLE of $\theta$ where $f_X(x;\theta)=1 \space \text{ or} \space \frac{1}{2\sqrt{x}}$

maximum likelihoodparameter estimationstatistics

I would like to have some input regarding my work for finding the MLE for $\theta$ for the following situation.

$X_1, … , X_n \sim_{iid} X$ where $x\in[0,1], \space \theta=1,2$ and

$$f_X(x;\theta)= \begin{cases} 1 & \text{if $\theta=1$} \\
\frac{1}{2\sqrt{x}} & \text{if $\theta=2$}\end{cases}$$

My argument is that
$$f_X(x;\theta)=\frac{1}{\theta}x^{1/\theta-1}$$
so using the usual process,

$$L(\theta)=\theta^{-n} \left[ \prod_{i=1}^n X_i \right]^{1/\theta -1}$$
$$l(\theta)=-n \ln\theta+ \left(\frac{1}{\theta}-1 \right)\sum_{i=1}^n \ln X_i $$
$$\frac{\partial}{\partial \theta} l(\theta)= \frac{-n}{\theta}+\frac{-1}{\theta^2}\sum_{i=1}^n \ln X_i$$

and I want to conclude that
$$\hat{\theta}_{MLE}=-\frac{1}{n}\sum_{i=1}^n \ln X_i$$

What bothers me here is that $\theta$ is either $1$ or $2$, so I believe that there is something crucial that I am missing. May I have some assistance?

Thank you.

Best Answer

The parameter space is discrete as $\theta$ takes two values $1$ and $2$. So your MLE should better be either of these values. To elaborate on the point @leonbloy makes, suppose we define a function $$I(\theta)=\begin{cases}1&,\text{ if }\theta=1 \\ 0&,\text{ if }\theta=2\end{cases}$$

Then the likelihood function given the data $x_1,\ldots,x_n\in(0,1)$ can be expressed as

$$L(\theta)=1^{I(\theta)}\left(\frac{1}{2^n \prod_{i=1}^n \sqrt{x_i}}\right)^{1-I(\theta)}\quad,\theta\in\{1,2\}$$

Clearly, $L(1)=1$ and $L(2)=\left(2^n \prod\limits_{i=1}^n \sqrt{x_i}\right)^{-1}$ for all $x_i\in(0,1)$.

So the MLE of $\theta$ must be $$\hat\theta=\begin{cases}1&,\text{ if }2^n \prod_{i=1}^n \sqrt{x_i}>1 \\ 2&,\text{ if }2^n \prod_{i=1}^n \sqrt{x_i}\le1\end{cases}$$

Related Question