If $X \sim \mathcal{N} (\mu,1)$ and $\mu \in (-m,m)$ where $0<m<1$ is a known constant. Then how can I work out the MLE of $\mu$ in this case?
I know in the case where $\mu$ is completely unknown, then the MLE $\hat{\mu} (X)$ is just $X$. However, I really need some insights into how to take into account the given range of $\mu$. Many thanks for any help.
As mentioned in the comments we will allow $\mu \in [-m,m]$ rather than $(-m,m)$. The likelihood function is $$L(\mu)=\frac{1}{2\pi}\exp(-\frac{(x-\mu)^2}{2}),$$ so maximizing the likelihood function is equivalent to minimizing the distance $$|x-\mu|.$$ If $x> m$, then the distance is minimized by $\hat{\mu} = m$ and if $x< -m$, then the distance is minimized by $\hat{\mu} = -m$, thus the maximum likelihood estimator is given by: $$\hat{\mu} := \begin{cases} -m & X < -m \\ X & X \in [-m,m] \\ m & X > m \end{cases}$$
Remark: If we only allow $\mu \in (-m,m)$, then the MLE is technically undefined for $X \in (-\infty,-m] \cup [m,\infty)$, that is why we should consider $\mu \in [-m,m]$ instead.