$\theta \in \{\cdots, -2, -1, 0, 1, 2, \cdots\}$.
Which of the following is the maximum likelihood estimator of $\theta$?
The problem asks for the Maximum Likelihood Estimator (MLE) of $\theta$ for $n$ independent and identically distributed (i.i.d.) random variables $X_1, X_2, \cdots, X_n$ from a Normal distribution $N(\theta, 1)$, with the constraint that $\theta$ must be an integer ($\theta \in \mathbb{Z}$).
Maximizing $\ln L(\theta)$ is equivalent to minimizing the term $\sum_{i=1}^{n} (x_i - \theta)^2$. If there were no constraint on $\theta$, we would find the derivative with respect to $\theta$ and set it to zero:
$\frac{d}{d\theta} \ln L(\theta) = \frac{d}{d\theta} \left(-\frac{1}{2} \sum_{i=1}^{n} (x_i - \theta)^2\right) = -\frac{1}{2} \sum_{i=1}^{n} 2(x_i - \theta)(-1) = \sum_{i=1}^{n} (x_i - \theta)$
Setting the derivative to zero:
$\sum_{i=1}^{n} (x_i - \theta) = 0 \implies \sum_{i=1}^{n} x_i - n\theta = 0 \implies n\bar{X} - n\theta = 0 \implies \theta = \bar{X}$
This shows that the value of $\theta$ that maximizes the likelihood (without constraints) is the sample mean, $\bar{X}$.
However, $\theta$ must be an integer. The likelihood function $L(\theta)$ (and $\ln L(\theta)$) is maximized when the sum of squared differences, $\sum_{i=1}^{n} (x_i - \theta)^2$, is minimized. This sum represents the sum of squared deviations from $\theta$. Geometrically, we are looking for the integer $\theta$ that is closest to the data points $x_1, \cdots, x_n$. The value that minimizes the sum of squared differences is the mean, $\bar{X}$. Since $\theta$ must be an integer, the integer value that minimizes this sum is the integer closest to $\bar{X}$.
For example, if $\bar{X} = 2.3$, the integers are 2 and 3. The sum of squares is minimized when $\theta=2$, because $|2.3 - 2| < |2.3 - 3|$. If $\bar{X} = 2.8$, the sum of squares is minimized when $\theta=3$, because $|2.8 - 3| < |2.8 - 2|$. If $\bar{X}=2.5$, both integers 2 and 3 minimize the sum equally (assuming we round halves up or down consistently, the definition of "closest" handles this).
Therefore, the maximum likelihood estimator of $\theta$ under the integer constraint is the integer closest to the sample mean $\bar{X}$.
| x | 0 | 1 | 2 | 3 |
| $p_{\theta_0}(x)$ | 0.01 | 0.04 | 0.5 | 0.45 |
| $p_{\theta_1}(x)$ | 0.02 | 0.08 | 0.4 | 0.5 |