# Maximum Likelihood from observed values

Give IID Data Samples $X_n =$ {$x_1, x_2, ..., x_n$} generated from a uniform distribution $U(x|0,\theta)$.

$p(x|\theta) = U(x|0,θ) =${$\frac{1}{\theta}$ for $0 \leq x \leq θ$ and $0$ otherwise}.

Now assuming $X_2 = [1, 3, 2, 4]$ have been observed.

What is the maximum likelihood arg $max \theta, p(X_2 | \theta)$?

The $p(X|\theta) = p(x_1, ..., x_n | \theta) = \theta^{-n}$

Taking log both sides we get $\log p(X|θ) = n\cdot \log(\frac{1}{θ})$ Taking derivative we get $\frac{-n}{\theta}$which is less than $0$.

Could you tell me how to proceed for the next?

• If the (log of the) likelihood is decreasing, at which end is the maximum? – Henry Apr 9 '14 at 0:14

This is a problem which is difficult to solve with the general technique. Note that the likelihood $$\mathcal{L}(\theta|x_1,\ldots,x_n) = p(x_1,\ldots,x_n|\theta) = \theta^{-n},$$ however you need to be careful here. The likelihood is the probability distribution of $\theta$ given the sample $\{x_1,\ldots,x_n\}$, so note that the above equality is valid only for $\theta>\max\{x_1,\ldots,x_n\}$, since otherwise the likelihood is zero. Now we need to find $\theta$ that maximizes the likelihood. From its easy form (decreasing from $\max\{x_1,\ldots,x_n\}$ onwards), you immedeatly see that the maximizer is $\theta_{ML} = \max\{x_1,\ldots,x_n\}$.