Let $X_1,\ldots,X_n$ be Uniform Distributed Random variables on $[0,\theta]$ and let T be $\max\{X_1,\ldots,X_n\}$ an estimator for $\theta$. I derived that the $F_T(x)=(\frac{x}{\theta})^n$ for $0<x<\theta$. Then I calculated the expected value of $T$,
$$\operatorname{E}[T]=\int_0^\theta x\cdot\frac{nx^{n-1}}{\theta^n} \, dx=\frac n {n+1} \theta$$
and that
$$
\operatorname{Var}(T)=\int_0^\theta x^2 \frac{nx^{n-1}}{\theta^n} \, dx – \left(\frac n {n+1}\theta \right)^2 = \frac n {n+2}\theta^2 – \left(\frac n {n+1} \theta\right)^2=\frac{n\theta^2}{(n+2)(n+1)^2}.
$$
When I now determine the Mean Squared Error of $T$, I find:
$$\operatorname{MSE}(T)=\operatorname{Var}(T)-(\operatorname{E}[T]-\theta)^2 = \frac{n\theta^2}{(n+2)(n+1)^2} – \left(\frac n {n+1}\theta-\theta\right)^2 = \frac{-2\theta^2}{(n+1)^2(n+2)}$$
However, as $\theta>0$, the Mean Squared Error of $T$ is negative so I was wondering whether anything was wrong with this calculation. Could anyone help me please?
Best Answer
Let $T$ be an estimator of $\theta$ and denote $E(T) = \mu.$ Then $$\text{MSE} = E[(T-\tau)^2] = E[((T - \mu) + (\mu -\tau))^2]\\ = E[(T-\mu)^2] + 2(\mu - \tau)E(T - \mu) + (\mu - \tau)^2\\ = Var(T) + 0 + b_T^2(\tau)$$
Here is a simulation in R statistical software for $W = \max(X_1, \dots, X_n)$ as an estimator of $\theta,$ where $X_i \stackrel{indep}{\sim} Unif(0,\theta),\ n=5,$ and $\theta=10.$ With a million iterations, quantities with original units should be accurate to three places, and quantities with squared units perhaps about two places.
Except for your incorrect sign (mentioned in the comments), your computations are compatible with simulation results.
Note: An unbiased estimator of $\theta$ is $2\bar X$, but it has a much larger variance ($4\theta^2/12n$), and hence a much larger MSE, than the maximum.
The histograms below compare the properties of these two estimators.