# How do I show that the mean of the posterior density minimizes this squared error loss function?

This exercise comes from Koop's Bayesian Econometrics. Given $\theta$, the parameter(s) of a model (in this case $\theta$ is a scalar), $\tilde{\theta}$, the point estimate of $\theta$, and constants $c_1 > 0, c_2 > 0$, the goal of the exercise is to show that $\tilde{\theta} = E[\theta \mid y]$ minimizes the expected loss of the squared error function $C(\tilde{\theta}, \theta) = (\tilde{\theta} - \theta)^2$, where, to quote the book, "the expectation is taken with respect to the posterior of $\theta$", i.e. $\theta \mid y$.

Per this meta question, I'm including my solution as a separate answer, both for feedback on that solution and for other people to post their own solutions.

• @Xi'an Thanks for pointing that out. [tag:self-study] can include questions that aren't homework, correct? I'm not a student, but I'm working through this book for something at work. Jan 28, 2016 at 21:17
• The self-study tag includes homework-like questions such as this one.
– Sycorax
Jan 28, 2016 at 21:24

Setting this equal to zero gives the critical value $\tilde{\theta} = E_{\theta \mid y} \left[ \theta \mid y \right]$. Since
• This is a correct solution, if missing the second order condition. You can however avoid derivatives by decomposing $E_{\theta \mid y} \left[ (\tilde{\theta} - E\theta)^2 \mid y\right]$ as $$E_{\theta \mid y} \left[ (\tilde{\theta} - E_{\theta \mid y}[\theta|y])^2 \mid y\right] +E_{\theta \mid y} \left[ (E_{\theta \mid y}[\theta|y] - \theta)^2 \mid y\right]$$by virtue of the Pythagorean Theorem. Jan 28, 2016 at 21:11