# MLE for a uniform distribution.

Let $X_1,\dots,X_n$ be a sample of independent random variables with uniform distribution $(0,\theta)$. Find a $\hat{\theta}$ as an estimator for $\theta$ using the maximum likelihood method. the pdf is $\dfrac 1 \theta$ for $\theta \le x \le 2\theta$.

I've had a go and found that the likelihood function is $θ^{-n}$, taken the log and differentiated it to find the max and got to $-\dfrac {n}{\theta}$. I've seen a similar answer posted here: maximum estimator method more known as MLE of a uniform distribution, but I don't understand what the order statistics reasoning is, and what bounds to impose (if any). I was also wondering how to check its a max when we look at the second order derivative?

• Sorry, what does the f(b)=sup part mean (not sure what the notation for the whole bit there means)? Also, how do we know that θ≥maxiXi? – raditz Jun 1 '13 at 14:13
• @DilipSarwate: I just edited what I saw. And I think $f(x)=1/\theta$ for $\theta \leq x \leq 2\theta$ means $Uniform(\theta,2 \theta)$. – A.D Jun 1 '13 at 15:26
• @DilipSarwate: But $\int_{\theta}^{2 \theta} 1/\theta dx=1/\theta(2\theta-\theta)=1$. So, there is no problem at all. – A.D Jun 1 '13 at 16:23

## 1 Answer

The likelihood function is $$L(\theta|\mathbb x)=\begin{cases}\dfrac{1}{\theta ^n},\,\,\,\theta \le x_i \le 2\theta ,\forall i\\0,\,\,\,\,\,\,\,\,\text{otherwise}\end{cases}$$ $$=\begin{cases}\dfrac{1}{\theta ^n},\,\,\,\theta \le x_{(1)} \le x_{(n)} \le2\theta \\0,\,\,\,\,\,\,\,\,\text{otherwise}\end{cases}$$ For $\theta \ge \dfrac {x_{(n)}}{2},L(\theta|\mathbb x)=\dfrac{1}{\theta ^n}$ is a decreasing function in $\theta$. Hence MLE of $\theta$ is $\color{blue}{\hat\theta=\dfrac{X_{(n)}}{2}}$.