Solution (source code)

= Solution

The MLE is $\hat\theta=n/S$, $S=\sum X_i$. Since $S\sim\Gamma(n,\theta)$, $\theta S\sim\Gamma(n,1)$ (in general $\gamma Y\sim\Gamma(\beta,\lambda/\gamma)$). If $q_r$ is the $r$-quantile of $\Gamma(n,1)$, a central confidence interval is $[(q_{\alpha/2}/n)\hat\theta,(q_{1-\alpha/2}/n)\hat\theta]$. A $\Gamma(\beta,\lambda)$ prior yields posterior $\Gamma(\beta+n,\lambda+S)$ and mean $\tilde\theta=(\beta+n)/(\lambda+S)$. With $q_r\prime$ the quantiles of $\Gamma(\beta+n,1)$, take $l\prime=q_{\alpha/2}\prime/(\beta+n)$ and $u\prime=q_{1-\alpha/2}\prime/(\beta+n)$.