The log-likelihood function and MLE in uniform distribution $U[\theta,5]$

log likelihoodmaximum likelihoodstatistical-inferencestatisticsuniform distribution

For uniform distribution $U[\theta,5]$ with sample size $n$,

Likelihood function is:
$$L(y;\theta) = (5-\theta)^{(-n)}$$
Log-likelihood function is:
$$\log(L(y;\theta)) = -n.\log(5-\theta)$$
For MLE take the derivative of log-likelihood with respect to $\theta$:
$$(\log(L(y;θ)))' = +n/(5-\theta)$$
$$θ = y(\min)$$
ymin is the minimum of the sample when ordered.In this case y(min)=1.9
Is this correct or am I making a mistake somewhere?Can you point out the mistakes and give an answer of the right form?

Best Answer

Suppose $Y$ is drawn from a uniform distribution on the interval $[\theta, 5]$ (where, a priori, $ \theta \leq 5$). Then the likelihood of $Y$ given $\theta$ is $$ L(Y; \theta) = \frac{1}{5-\theta} \text{.} $$ Now let $y$ be a sample of $n$ realizations of $Y$, $y = (y_1, \dots, y_n)$. Note that, necessarily, $\theta \leq y_i$ for all $i$, so let $m$ be the minimum of the $y_i$. The likelihood of $y$ given $\theta$ is $$ L(y; \theta) = \begin{cases} c_y \prod_{i=1}^n L(Y;\theta) ,& \theta \leq m \\ 0 ,& m < \theta \end{cases} \text{,} $$ where $c_y > 0$ is a normalization constant. Then $$ L(y; \theta) = \begin{cases} c_y \left(\frac{1}{5-\theta}\right)^n ,& \theta \leq m \\ 0 ,& m < \theta \end{cases} \text{.} $$ We wish to maximize the likelihood with respect to $\theta$. It is traditional to take logarithms as a computational aid, however $$ \frac{\mathrm{d}}{\mathrm{d}\theta} \ln L(y; \theta) = \frac{\mathrm{d}}{\mathrm{d}\theta} \ln \left( \begin{cases} c_y \left(\frac{1}{5-\theta}\right)^n ,& \theta \leq m \\ 0 ,& m < \theta \end{cases} \right) $$ has an undefined second piece when taking logarithms, so we do not. \begin{align*} \frac{\mathrm{d}}{\mathrm{d}\theta} L(y;\theta) &= \frac{\mathrm{d}}{\mathrm{d}\theta} \left( \begin{cases} c_y \left(\frac{1}{5-\theta}\right)^n ,& \theta \leq m \\ 0 ,& m < \theta \end{cases} \right) \\ &= \begin{cases} c_y n \left(\frac{1}{5-\theta}\right)^{n+1} ,& \theta < m \\ \text{undefined} ,& \theta = m \\ 0 ,& m < \theta \end{cases} \text{,} \end{align*} where the derivative is undefined at $\theta = m$ because the function is not continuous there. Since we are maximizing, we want critical points. Since no value of $\theta$ makes $c_y n \left(\frac{1}{5-\theta}\right)^{n+1} = 0$ or be undefined, we have found that $(-\infty, m]$ is the set of critical points. Evaluating $L(y;\theta)$ on the set of critical points, we discover we are always using the first piece of that function, so we study $c_y \left(\frac{1}{5-\theta}\right)^n$ on $(-\infty, m]$. We know $$ \frac{\mathrm{d}}{\mathrm{d}\theta} c_y \left(\frac{1}{5-\theta}\right)^n = c_y n \left(\frac{1}{5-\theta}\right)^{n+1} $$ on $(-\infty, m)$. Since $c_y > 0$, $n > 0$, and $\theta \leq 5$, this is either a positive number or $y_i = 5$ for all $i$. If it is a positive number and since $L(y;\theta)$ is continuous on $(-\infty, m]$, the maximum occurs at $\theta = m$. If $y_i = 5$ for all $i$, then $L(y; \theta)$ is only nonzero at $\theta = m$, where it is positive. In either case, the maximum occurs at $\theta = m$.