# Find exact confidence interval for uniform distribution

In my homework I have $$X_1,...,X_n$$ which are all uniformly distributed on $$(0,\theta)$$

I have concluded that the $$MLE=\hat{\theta}=max(X_1,...,X_n)$$ because:

$$L_x(\theta)= \frac{1}{\theta^n}$$ so the likelihood is a decreasing function. However we also know that $$\theta > max(X_1,...,X_n)$$, hence $$\hat{\theta}=max(X_1,...,X_n)$$

But I need to find an exact 95% confidence interval for $$\theta$$. I think the book wants me to find a pivot

I have tried to set $$P(X \in (0,X_n))=(\frac{X_n}{\theta})^n$$ for some $$\theta>X_n$$

Therefore $$P(X \in (X_n,\theta))=1-(\frac{X_n}{\theta})^n=0.95$$ which gives me

$$\theta=\frac{X_n}{0.05^{1/n}}$$

However I am pretty sure this is not the way to go and it is not a standard method. There should be some more standard method but using $$L,\ell_X, \ell_X'=0$$ just gives me MLE=0 which is of no use

Any help/hint would be appreciated

• Typo, I have changed it now – Daniel Apr 20 '20 at 18:53
• Can you find the distribution of $\hat\theta$? – StubbornAtom Apr 20 '20 at 19:05
• No, it doesn't have any standard distribution. A simulation shows it looks exponential but that doesn't help much. I tried calculating the upper bound of $\theta$ as $X_n/0.05^{1/n}=\theta_{upper}$ – Daniel Apr 21 '20 at 6:39
• Distribution is standard. A pivot for $\theta$ is $\hat\theta/\theta$ (it has a standard distribution). Here is one particular confidence interval (in fact the shortest length interval) based on this pivot. – StubbornAtom Apr 21 '20 at 18:28

Your estimator is definitely wrong. Please check your work. As for the confidence interval it will probably be a one sided confidence interval. If you will use the basic definition of confidence interval you will be good to go. Hint: $$P(max(X_1, X_2, X_3,.....,X_n)< c) = \prod_{i=1}^{n}{P(X_i
• Sorry, made a typo, the interval is $(0,\theta)$ – Daniel Apr 20 '20 at 18:53
What you did was correct but except for some typo, it is not $$X_n$$ but max($$X_i$$), and do not forget the lower bound max($$X_i$$). (you already stated that $$\theta\geq \hat{\theta}$$)