Maximum likelihood estimation of $a,b$ for a uniform distribution on $[a,b]$ I'm supposed to calculate the MLE's for $a$ and $b$ from a random sample of $(X_1,...,X_n)$ drawn from a uniform distribution on $[a,b]$. But the likelihood function, $\mathcal{L}(a,b)=\frac{1}{(b-a)^n}$ is constant, how do I find a maximum? Would appreciate tips on how to proceed!
 A: Think about it a bit. If $b$ is less than the maximum of the observations, then the likelihood is $0$. Similarly, if $a$ is greater than the minimum of the observations, then the likelihood is also $0$ (since you have observations lying outside $[a,b]$ which is probability $0$). Then, if you make $b$ bigger than the max or $a$ smaller than the min, the denominator of the likelihood gets bigger (since the difference of $a$ and $b$ clearly gets bigger), so the likelihood is necessarily lower than $b=\max_i X_i$ and $a = \min_i X_i$. 
A: The likelihood is simply the probability of observing the data under given parametric assumptions. Here: $P(x\in [a,b])=\frac{1}{b-a} \implies \mathcal{L}(a,b;n)=\frac{\prod\limits_{i=1}^n \mathbf{1}_{[a,b]}(x_i)}{(b-a)^n}$, the key to this is the numerator..most people forget this and then wonder why we don't set $a=b$. Thus, to maximize the likelihood, you need to minimize the value $(b-a)$ subject to having all data contained in $[a,b]$. Thus, you want $a=\min x_i$ and $b=\max x_i$
A: Hint: Look at the endpoints of your interval for a maximum. For a Uniform-distribution $x$ is only defined for $a<x<b$. Can you take it from here?

Also look here: maximum estimator method more known as MLE of a uniform distribution
Only difference with the link provided is that you are asked to find two MLE's, one for the beginpoint and one for the endpoint of the interval. 
A: First, $ a\leq \min(X_1 , \ldots , X_n) $ and $ b\geq \max(X_1 , \ldots , X_n) $
That is because otherwise we wouldn't be able to have the samples $ X_i $ which are less than $ a $ or greater than $ b $ because the distribution is
$$ X_i \sim \operatorname{Unif}(a,b) $$
and the minimum value $ X_i $ can have is $ a $, and the maximum value $ X_i $ can have is $ b $.
The likelihood function is
$$ \mathcal{L}(a,b)= \prod_{i=1}^n f(x_i;a,b)
= \prod_{i=1}^n \frac{1}{(b-a)}
= \frac{1}{(b-a)^n} $$
Consider the log-likelihood function
$$ \log\mathcal{L}(a,b) = \log{\displaystyle \prod_{i=1}^{n} f(x_i;a,b)}
= \displaystyle \log\prod_{i=1}^{n} \frac{1}{(b-a)}
= \log{\big((b-a)^{-n}\big)} = -n \cdot \log{(b-a)} $$
Note that we are looking for the arguments $a$ and $b$ that maximizes the likelihood (or the log-likelihood)
Now, to find $ \hat{a}_{MLE} $ and $ \hat{b}_{MLE} $ take the log-likelihood function derivatives with respect to $ a $ and $ b $
$$ \frac{\partial}{\partial a} \log\mathcal{L}(a,b) = \frac{n}{(b-a)} \\
\frac{\partial}{\partial b} \log \mathcal{L}(a,b) = -\frac{n}{(b-a)}
 $$
We can see that the derivative with respect to $ a $ is monotonically increasing, So we take the largest $ a $ possible which is $$ \hat{a}_{MLE}=\min(X_1 , ... , X_n) $$
We can also see that the derivative with respect to $ b $ is monotonically decreasing, 
so we take the smallest $ b $ possible which is $$ \hat{b}_{MLE}=\max(X_1 , ... , X_n) $$
