[Math] Unbiased estimator of a uniform distribution

statistics

For a random sample $X_1,X_2,\ldots,X_n$ from a $\operatorname{Uniform}[0,\theta]$ distribution, with probability density function
$$ f(x;\theta) =
\begin{cases}
1/\theta, & 0 \le x \le \theta \\
0, & \text{otherwise}
\end{cases} $$

Let $X_{\max} = \max(X_1,X_2,\ldots,X_n).$ What is the value of k such that $\hat \theta = kX_{\max}$ is an unbiased estimator of $\theta$ ?


I'm not sure if there is more to this question, because my intuitive answer answer is just $k=1$. This is because if you order the sample like $$x_{(1)} \le x_{(2)} \le \cdots \le x_{(n)}$$
such that $x_{(n)} = E[X_{\max}]$. and the fact that the distribution is uniform, the estimator of $\theta$ should just be $X_{\max}$.

Unbiased estimator -> $E\left[\widehat{\theta\,}\right] = kE[X_{\max}] = \theta$

Is my logic wrong here?

Best Answer

Another answer has already pointed out why your intuition is flawed, so let us do some computations.

If $X$ is uniform, then: $$ P(X_{max}<x)=P(X_i<x,\forall i)=\prod_i P(X_i<x)= \begin{cases} 1 & \text{if } x\ge \theta \\ \left(\frac{x}{\theta}\right)^n & \text{if } 0\le x\le \theta \\ 0 & \text{if } x\le 0 \end{cases} $$ so the density function of $X_{max}$ is: $$ f_{max}(x;\theta)=\begin{cases} \frac{n}{\theta^n}x^{n-1} & \text{if } 0\le x\le \theta \\ 0 & \text{otherwise} \end{cases} $$ Then we can compute the average of $X_{max}$: $$ E(X_{max})=\int_0^\theta x \frac{n}{\theta^n}x^{n-1} dx =\frac{n}{n+1} \theta $$ so $X_{max}$ is biased whereas $\frac{n+1}{n}X_{max}$ is an unbiased estimator of $\theta$.