A Bayes estimator minimizes the integrated loss function under the prior and sampling distribution. For a nonnegative loss, Tonelli's theorem and the posterior distribution give the risk decomposition
where is the marginal density. Thus choosing, for each observed , a measurable minimizer of the posterior expected loss minimizes the integrated risk. Observations of marginal probability zero do not affect the rule.
Here the likelihood is and the prior is on positive parameters. Put . Their product is , and . The marginal density and posterior are therefore
This Gamma-exponential conjugacy calculation gives a Gamma distribution with shape and rate . It is the posterior, rather than the prior alone, which determines both requested estimators.
Multiplying the likelihood by the gamma distribution prior density gives
Thus Gamma-exponential conjugacy gives
where the second parameter is the rate. Under squared-error loss, the Bayes estimator under squared error loss is the posterior mean, hence