Estimating Uniform distribution endpoints using data with errors Suppose I have a random variable $X$ ~ $Unif(0,\theta)$ where I want to estimate $\theta$. I draw a sample $X_1,...,X_n$.One way is to get a point estimate using e.g.  maximum likelihood estimation via the sufficient statistic $X_{(n)}$.
However, suppose I want a 95% confidence interval of sorts on the value of $\theta$, how should I construct one?
The reason why I am interested in confidence interval is because of the following issue, which is actually my main question (the above prelude on confidence interval is just a suggestion on possible approach). So actually my sample came with some noise, in a sense that I actually observe $X_1+E_1,...,X_n+E_n$ where $E_i$~$N(0,\sigma_i^2)$ independently from each other and from the $X$'s. How should I make some form of statistical estimation about $\theta$? I would prefer some form of confidence estimate.
 A: You can just use maximum likelihood! First, you give the standard deviation of your normal random variable $E_i$ as $\sigma_i$. If that is really what you want, you are more or less out of luck, since you then have more parameters than observations. So I will presuma that was a slip, and assume identical standard deviations $\sigma$.
Then, each of your observations have the distribution of the sum independent uniform and normal variables. So first we must find that distribution, which is an exercise in convolution.
Let $f(x) = \frac{1}{\theta}I_{0 \le x \le \theta}(x)$ be the uniform density and $g(e)$ be the normal density. Calculating the convolution we get
$$
   \begin{align}  f \ast g (x) &= \int f(x-e) \frac{1}{\sqrt{2\pi \sigma^2}} e^{-\frac12(\frac{e}{\sigma})^2} \, de = \\
  &=  \frac{1}{\theta} \int_{x-\theta}^x \frac{1}{\sqrt{2\pi}\sigma} e^{-\frac12(\frac{e}{\sigma})^2} \, de   \\
&=  \frac{1}{\theta} \int_{\frac{x-\theta}{\sigma}}^{\frac{x}{\sigma}}
     \frac{1}{\sqrt{2\pi}} e^{-\frac12 u^2} \, du =  \\
&=  \frac{1}{\theta} \left( \Phi(x/\sigma) - \Phi((x-\theta)/\sigma) \right)
\end{align}
$$
where we have used a simple substitution, and where $\Phi$ is the standard normal cumulative distribution function. Now, this can be used as usual for maximum likelihood estimation. Let us write the density function we found above as $h(u; \theta, \sigma)$.
Then the likelihood function is
$$
   L(u;\theta, \sigma) = \prod_{i=1}^n h(u_i;\theta,\sigma)
$$
so the log-likelihood becomes
$$
  l(u;\theta,\sigma) = -n\log\theta + \sum_{i=1}^n \log \left (
      \Phi(u_i/\sigma) -\Phi((u_i-\theta)/\sigma) \right )
$$
Maximize this over the unknown parameters!
EDIT after the comments:
Then I will continue assuming $\sigma$ is known! You can extend it to your case with distinct known $\sigma_i$.  We can make a confidence interval on $\theta$ by likelihood profiling. We just use the (asymptotic) result that
$$
   2(l(\hat{\theta})-l(\theta)) \sim \chi^2_d
$$
where $\sim$ is read "distributed as" and $d$ is the dimension of $\theta$, in our case 1. 
$\hat{\theta}$ is the maximum likelihood estimator.
You can invert this (numerically) to get a confidence interval.
