Find the MLE for discrete parameters

maximum likelihoodparameter estimationstatistical-inferencestatistics

Let $\mathrm{X}_{1}, \mathrm{X}_{2}, \ldots, \mathrm{X}_{n}$ be a random sample from a distribution with one of two possible pdfs:
$$
f(x ; \theta)=\left\{\begin{array}{ll}{\frac{1}{\sqrt{2 \pi}} e^{-x^{2} / 2},} & {-\infty<x<\infty, \theta=1} \\ {\frac{1}{\pi\left(1+x^{2}\right)},} & {-\infty<x<\infty, \theta=2}\end{array}\right.
$$

Find the MLE $\hat{\theta}$ for $\theta \in\{1,2\}$.

if I understand correctly what the MLE is, it's the value of $\theta$ (could depend on the $X_i$'s) that maximizes the likelihood function.

by the positivity of things, it should be just a matter of comparing the two possible pdfs, however none of them is all the time bigger than the other, so what do we do here ? does the MLE just doesn't exist ?

Best Answer

this answer was based on this

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(-\infty,\infty)$ can be expressed as

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

Clearly, $L(1)=\frac{e^{-\frac12 \sum_{i =1}^{n} x_i^2}}{(2\pi)^{\frac{n}{2}}}$ and $L(2)=\left(\pi^n \prod_{i=1}^n(1+x_i^2)\right)^{-1}$ for all $x_i\in(-\infty,\infty)$.

So the MLE of $\theta$ must be $$\hat\theta=\begin{cases}1&,\text{ if } (\frac{\pi}{2})^{\frac n2} e^{-\frac12 \sum_{i =1}^{n} x_i^2}\prod_{i=1}^n(1+x_i^2)>1 \\ 2&,\text{ if }(\frac{\pi}{2})^{\frac n2} e^{-\frac12 \sum_{i =1}^{n} x_i^2}\prod_{i=1}^n(1+x_i^2)\le1\end{cases}$$