Point estimate for quadratic loss function

bayesianestimationparameter estimation

Suppose $X_1,\dots,X_n$ are IID from a distribution uniform on $\left(\theta-\frac{1}{2},\theta + \frac{1}{2}\right)$, and that the prior for $\theta$ is uniform on $(10,20)$. Calculate the posterior distribution for $\theta$ given $x = X_1,\dots,X_n$ and show that the point estimate for $\theta$ under both quandratic and absolute error loss functions is:
$\begin{equation}
\hat{\theta} = \frac{1}{2}\left[\max(\max_i(x_i-\frac{1}{2}),10) + \min(\min_i(x_i+\frac{1}{2}),20)\right]
\end{equation}$
.

My solution so far has been the following, and I do not seem to be getting at the same result as the question:

We need to evaluate $f(\theta|x)$. We can do this using Bayes' formula:

$f(\theta|x)=\frac{f(x|\theta)f(\theta)}{\int_{10}^{20}f(x|\theta)f(\theta)d\theta}$.

$f(\theta) = \frac{1}{10}$, as the prior for $\theta$ is uniform on $(10,20)$.

Now, $f(x|\theta) = f(x_1,\dots,x_n|\theta) = \prod f(x_i|\theta) = \prod 1 = 1$. Which means that $f(\theta|x) = \frac{1}{10}$. This would imply that the posterior mean, which would maximise $\theta$ would be $\int_{10}^{20}\theta\cdot \frac{1}{10}d\theta=15$, which is obviously different to the $\hat{\theta}$ in the question.

What am I doing wrong? Intuitively, I am doing something wrong when calculating $f(x|\theta)$, as I should move to the cdf and get a product of all $x_i$'s. However, differentiating that would still yield 1.

Best Answer

You say $f(x\mid \theta) = f(x_1,\ldots,x_n\mid\theta) = \prod f(x_i\mid \theta) = \prod 1 = 1$

but this is only true when each of the $x_i \in \left(\theta-\frac{1}{2},\theta + \frac{1}{2}\right)$

You should use indicators for this. If you do, then you will be left with a posterior distribution for $\theta$ which is uniform on the interval $\Big(\max(\max_i(x_i-\frac{1}{2}),10) , \min(\min_i(x_i+\frac{1}{2}),20)\Big)$

Under the quadratic error loss function the best point estimate is the mean of the posterior distribution, while under the absolute error loss function the best point estimate is the median of the posterior distribution. For a uniform distribution on an interval, both of these are the midpoint of the interval.