What is MLE of $U[-k,7k]$? I need to find maximum likelihood estimator of uniform distribution $X : U[-k,7k]$.
I think that the answer is $max\{x_1, ..., x_n \}$ . However, I think I have a mistake because if $X : U[0,k]$ the answer would be the same. So, it seems strange to me why MLE does not depend on the length of the interval.
 A: Suppose $k = 1$ and your sample is $(-0.9, 0.2, 2.5, 3.7, 4.2)$.  Based on the sample maximum $4.2$, your estimate of $k$ would be $(4.2)/7 = 0.6$.  But based on the sample minimum, $-0.9$, your estimate would be $0.9$.  Which one is better?  Can you think of a way to write a mathematical expression to reflect this?

Here is the sufficient statistic calculation.
Let the sample be $\boldsymbol x = (x_1, \ldots, x_n)$, and as usual, define the minimum and maximum order statistics $x_{(1)} = \min \boldsymbol x$, $x_{(n)} = \max \boldsymbol x$, respectively.  Then we have $$f(\boldsymbol x \mid k) = \prod_{i=1}^n \frac{1}{8k} \mathbb 1 (-k \le x_i \le 7k) = (8k)^{-n} \mathbb 1 (-k \le x_{(1)} \le x_{(n)} \le 7k).$$  So by the Factorization theorem, a sufficient statistic is $T(\boldsymbol x) = (x_{(1)}, x_{(n)})$.  This happens to be minimal, but it is not necessary to prove this.  The point of finding $T$ is to show that any MLE of $k$ will be expressible as a function of $T$.
As for the MLE, we have the likelihood
$$\mathcal L(k \mid x_{(1)}, x_{(n)}) \propto k^{-n} \mathbb 1(-k \le x_{(1)} \le x_{(n)} \le 7k).$$  Because $k^{-n}$ is a monotone decreasing function of $k$, $\mathcal L$ is maximized for the smallest possible positive choice of $k$ that keeps the indicator function equal to $1$; that is to say, we require that $k \ge x_{(n)}/7$ and $k \ge -x_{(1)}$.  Equivalently, $$k \ge \max\left(\frac{x_{(n)}}{7}, -x_{(1)}\right).$$  Therefore, the desired MLE is $$\hat k = \max\left(\frac{x_{(n)}}{7}, -x_{(1)}\right).$$
A: Consider that for any $X_i$ you have that
$$-k\leq X_i\leq 7k$$
thus
$$\begin{cases}
-k\leq X_{(1)} \\
7k\geq X_{(n)}
\end{cases}$$
Thus
$$k\geq \max\left(-X_{(1)};\frac{X_{(n)}}{7}\right)$$
Given that the likelihood ($1/(8k)^n$) is strictly decreasing in $k$
$$T=\max\left(-X_{(1)};\frac{X_{(n)}}{7}\right)$$
is MLE
