# MLE of $\sqrt{\frac{2}{\pi}}\exp\left({-\frac{1}{2}(x-\theta)}^2\right)$

Consider a random sample of size $n$ from a distribution with probability density function (pdf) is given by

$$f(x;\theta)=\left\{\begin{matrix} \sqrt{\frac{2}{\pi}}e^{-\frac{1}{2}(x-\theta)^2}&\text{if }\space x\geq \theta \\ 0&\text{elsewhere} \end{matrix}\right.$$

Find the maximum likelihood estimator of $\theta$.

My attempt,

$$L(\theta)=\prod_{i=1}^{n}\sqrt{\frac{2}{\pi}}e^{-1/2(x_i-\theta)^2}$$

$$=\exp(-\frac{1}{2}\sum_{i=1}^{n}(x_i-\theta)^2)\cdot constant$$

$$\log L=-\frac{1}{2}\sum_{i=1}^{n}(x_i-\theta)^2+constant$$

$$\frac{\delta}{\delta \theta}\log L=\sum_{i=1}^{n}(x_i-\theta)$$

$$=\sum_{i=1}^{n}x_i-n\theta$$

$$n\theta=\sum_{i=1}^{n}x_i$$

$$\hat{\theta}=\bar{x}$$

Am I correct?

• Yes you found how to get the MLE for the mean of a Gaussian distributed sample. Jun 19, 2018 at 14:53
• @MartijnWeterings Given the constraint on the support, which leaves us with the right half of a unit variance Gaussian, I would imagine the MLE of $\theta$ is much smaller than $\bar{x}$
– khol
Jun 19, 2018 at 15:30
• When the support depends on the parameter, instead of flatly differentiating (which isn't really justified here), pay attention to the parameter space given the sample. Jun 19, 2018 at 15:50
• @khol I had missed that part. It is indeed as Jarle stated. For the half normal distribution the likelihood function is zero unless $\theta$ is smaller than the smallest $x_i$. Thus you get a $\mathcal{L}(\theta)$ which is a parabolic function centered at $\bar{x}>x_{(1)}$, but cut off to 0 at the point $x_{(1)}$. Jun 19, 2018 at 16:59

For $\theta\le x_{(1)}$ the likelihood is an increasing function of $\theta$ and for $\theta>x_{(1)}$, the likelihood is zero. Hence, the MLE of $\theta$ is $\hat\theta=X_{(1)}$.