Given $X_1,..X_n$ observations of a population with densitiy
$$f(x)=\left\{\begin{matrix} \frac{1}{b-a} \text{ if } x \in (a,b)\\ 0 \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\text{ else } \end{matrix}\right.$$
where interval limits $a$ and $b$ are unknown. Determine the maximum likelihood estimations for $a$ and $b$.
This is example task from exam and I like to know how solve it correctly.
When I understand formula of maximum likelihood estimation correct,
This is maximize when $(b-a)$ is as small as possible but also important that $(a,b)$ include all the data. For this reason we have
$$a = \min(x_1,..,x_n)$$
and
$$b=\max(x_1,..,x_n)$$
I hope this is all correct like that or all wrong? : /
You are right. Recall the definition of the MLE, that is $$ \hat{\theta} = \arg\max_{(a,b) \in \Theta} \frac{1}{(b - a)^n}\, , $$ and $a \le X_i \le b$ for all $i$, thus you have to choose the closest statistics to $b$ and $a$ over $\Theta$ in order to maximize the likelihood (over the parametric space). Namely, $$ \hat{a} = \min\{X_1,...,X_n\}\, ,\quad \hat{b} = \max\{X_1,...,X_n\} \, . $$ But note that you need the equality in $a \le X_i \le b$, otherwise the MLE is not in the parametric space.