# A Monte Carlo confidence interval method for the maximum of a uniform distribution?

If there are $n$ samples $X_1 \leq X_2 \leq ... \leq X_n$ from a continuous uniform distribution with pdf $f(x)=\frac{1}{\theta},0\leq x \leq \theta$, then it is well known that the MLE for $\theta$ is $\hat{\theta}=X_n$.

However, if the bootstrap is used to estimate the confidence interval of $\hat{\theta}=X_n$, we see that the confidence interval will be something like $[aX_n,X_n], 0< a < 1$.

I'm wondering if there's a Monte Carlo method that can give a more reasonable confidence interval, maybe something like $[X_n,bX_n],b>1$?

Yes, this is a classic example of when the bootstrap is inconsistent, but subsampling yields valid inference. See Swanepoel (1986), Politis and Romano (1994) or Canty et. al. (2006).

• +1, and I took a liberty of adding one of my favorite bootstrap references by Canty, Davison, Hinkley & Ventura (2006, CJS). If access to CJS is difficult to obtain, there was a technical report version of it on one of the authors' websites (somewhere in .ch domain, as far as I can recall). – StasK Mar 23 '12 at 19:13
• Can you provide me with some details on how I can apply subsampling to the problem I posted? – Tianyang Li Mar 24 '12 at 16:05
• @StasK I hope that there is a detailed treatment of the problem I posted? – Tianyang Li Mar 24 '12 at 16:07

Why not just use the definition of confidence interval?

You seek an upper confidence limit for $\theta$, say with $1-\alpha$ coverage. Because this is tantamount to estimating a scale and $X_n$ is your test statistic, you should seek a UCL of the form $cX_n$ for some universal constant $c$. All this means (by definition) is that

$$1-\alpha = {\Pr}_\theta[c X_n \ge \theta] = {\Pr}_\theta[X_n \ge \theta/c] = 1-\left(\frac{1}{c}\right)^n.$$

The solution is $c = \alpha^{-1/n}$.

Interestingly, a lower confidence limit for $\theta$ can be found in the same way, in the form LCL = $b X_n$ with $b = (1-\alpha)^{-1/n}$. This confidence interval never contains $\hat{\theta} = X_n$!

For example, suppose $n=10$ and we seek a (symmetric) two-sided 95% confidence interval, so that $\alpha = 0.025$. Thus $c=1.446126$ and $b=1.002535$: we have 95% confidence that the limit of the underlying uniform distribution, $\theta$, lies between 1.446 and 1.003 times the largest of 10 iid draws from that distribution.

As a test (in R):

# Specify the confidence.
alpha <- 1 - 0.95

# Create simulated values.
n <- 10                                 # Number of iid draws per trial
nTrials <- 10000                        # Number of trials
theta <- 1                              # Parameter (positive; its value doesn't matter)
set.seed(17)
x <- runif(n*nTrials, max=theta)        # The data
xn <- apply(matrix(x, nrow=n), 2, max)  # The test statistics

# Compute the coverage of the simulated intervals.
ucl.k <- (alpha/2)^(-1/n)
lcl.k <- (1-alpha/2)^(-1/n)
length(xn[lcl.k * xn <= theta & theta <= ucl.k * xn]) / nTrials


This (reproducible) example yields 95.05%, as close as one can hope to the nominal coverage of 95%.

• I'm currently working on something very similar to this but the theoretical distribution is very hard to calculate accurately, so I'd like a Monte Carlo method that works here. – Tianyang Li Mar 24 '12 at 3:41
• tmy, Consider posting a question that contains the distribution you're actually interested in. – whuber Mar 24 '12 at 19:00