# Calculating the maximum likelihood estimator given density function

Find the maximum likelihood estimator of the unknown parameter $\theta$ if $X_1, X_2,..., X_n$ is a sample from a distribution whose density function is $$f_x(x) = (1/2)e^{-{|x-\theta|}}, -\infty < x < \infty$$ Hint: It might be easier to consider separately the cases where n is odd and n is even.

So far, I used the log-likelihood function to get to: $$L(X_1...X_n;\theta) = n\ln(1/2)-\sum_{j=1}^n |x_j- \theta|$$ Now, I need to take the derivative with respect to $\theta$, but the summation of the absolute value is throwing me off and I don't know how to approach this. I feel like I can handle the problem once I get through this part, so any help in terms of approaching this would be greatly appreciated.

Thanks!

$\sum_{j=1}^{n}\left|\theta-x_j\right|$ is minimized by the median of the $x_j$’s. So you should consider the cases $n$ is odd or even.
The derivative is: $$\frac{d}{d\theta}|x-\theta|=\frac{x-\theta}{|x-\theta|}=\frac{x-\theta}{\sqrt{(x-\theta)^2}}$$ which should help you finish the problem.
• Rather than the last equality, I would have ended with saying this is the sign of $x-\theta$. In particular you are going to want it to be zero when $x=\theta$, at least for the $n$ odd case, even if that is not strictly the derivative. – Henry Nov 25 '13 at 8:26