Solution (source code)

= Solution

Multiplying the <exponential family> likelihood by its <natural conjugate prior> gives
$$
\pi(\theta\mid x)
=\exp\left\{
\theta^T(\lambda_1+T(x))
-Z(\theta)(\lambda_2+1)
-\widetilde Z(\lambda_1+T(x),\lambda_2+1)
\right\}.
$$
Thus the posterior remains in the same family, with updated <hyperparameters>
$$
\lambda_1'=\lambda_1+T(x),
\qquad \lambda_2'=\lambda_2+1.
$$
Under <quadratic loss>, the <Bayes estimator under squared error loss> is the <posterior mean>. Differentiating the <cumulant function of an exponential family>[log-partition function] that normalizes the conjugate prior gives
$$
\widehat\theta
=\mathbb E[\theta\mid x]
=\nabla_{\lambda_1}\widetilde Z
(\lambda_1+T(x),\lambda_2+1).
$$