I would like to use the maximum log-likelihood method to find which continuous uniform distribution with the parameters $a$ and $b$ fits best to some observed data values $(x_{0}, \dots, x_{n})$.
I guess the best answer is always $[\min(x), \max(x)]$ but I am using this for the purpose of implementing the relevant algorithms.
The log-likelihood is equal to $$\mathcal{L} = \sum_{i=1}^{n} \log f(x_{i} | a, b).$$
Interestingly, there is a problem with observations $x_{i} < a$ and $x_{i} > b$ (where the density is zero) since the logarithm is undefined at zero.
What's the preferred way to correct for this? I first though to calculate $\log(1 + x_{i})$ (since the optimization algorithm does not care about the plus one) but then I started to think whether some other alternative would be better. Is there any best practice regarding this?