TITLE: maximum estimator method more known as MLE of a uniform distribution
QUESTION [35 upvotes]: Let  $ X_1, ... X_n $ a sample of independent random variables with uniform distribution $(0,$$
\theta 
$$
) $
Find a $ $$
\widehat\theta 
$$
 $ estimator for theta using the maximun estimator method more known as MLE

REPLY [66 votes]: First note that $f\left({\bf x}|\theta\right)=\frac{1}{\theta}$ ,
for $0\leq x\leq\theta$ and $0$ elsewhere.
Let $x_{\left(1\right)}\leq x_{\left(2\right)}\leq\cdots\leq x_{\left(n\right)}$
be the order statistics. Then it is easy to see that the likelihood
function is given by 
$$L\left(\theta|{\bf x}\right) = \prod^n_{i=1}\frac{1}{\theta}=\theta^{-n}\,\,\,\,\,(*)$$
  for $0\leq x_{(1)}$ and $\theta \geq x_{(n)}$ and $0$ elsewhere.
Now taking the derivative of the log Likelihood wrt $\theta$ gives:
$$\frac{\text{d}\ln L\left(\theta|{\bf x}\right)}{\text{d}\theta}=-\frac{n}{\theta}<0.$$
 So we can say that $L\left(\theta|{\bf x}\right)=\theta^{-n}$ is
a decreasing function for $\theta\geq x_{\left(n\right)}.$ Using
this information and (*) we see that $L\left(\theta|{\bf x}\right)$
is maximized at $\theta=x_{\left(n\right)}.$ Hence the maximum likelihood
estimator for $\theta$ is given by $$
\hat{\theta}=x_{\left(n\right)}.$$