Question 14. Inverse-gamma waiting time
The waiting time until the mth animal at location i has density
f(x_i\mid\theta) = \frac{1}{\Gamma(m)\,\theta^{m}}x_i^{m-1}e^{-x_i/\theta}, \quad x_i>0,
so \theta>0 is a scale. The prior is
f(\theta) = \frac{\beta_0^{\alpha_0}}{\Gamma(\alpha_0)}\theta^{-\alpha_0-1}e^{-\beta_0/\theta}, \quad\alpha_0>0,\ \beta_0>0.
The exam states that the maximum likelihood estimator is \hat\theta=\bar x/m.
(i) State the prior mean. [1 mark]
(ii) Find and identify the posterior distribution of \theta. [5 marks]
(iii) State the posterior mean, and show that it is a weighted sum of the prior mean and \hat\theta. [5 marks]
(iv) What happens to the posterior mean as m\to\infty? [2 marks]
(v) What happens if \alpha_0,\beta_0\to 0? [2 marks]
(vi) Complete: “The effect of the prior hyperparameters \alpha_0 and \beta_0 on the posterior mean of \theta is like…” [2 marks]
(vii) Describe a posterior 100(1-\alpha)\% credible interval for \theta. [5 marks]
Definitions. Here m is a known gamma shape and \theta is its unknown scale: the sampling kernel in \theta is \theta^{-m}\exp(-x/\theta). This differs from a gamma rate parameterisation. Write T=\sum_i x_i and use \operatorname{InvGamma}(\alpha_0,\beta_0) with kernel \theta^{-\alpha_0-1}e^{-\beta_0/\theta}. The estimator \hat\theta=T/(nm) has the same units as \theta.
The sampling density is gamma with shape m and scale \theta, so \mathbb{E}(X_i\mid\theta)=m\theta and the supplied estimator \hat\theta=\bar x/m is the maximum likelihood estimator.
(i) For \alpha_0>1,
\mathbb{E}(\theta)=\beta_0/(\alpha_0-1).
(ii) The likelihood contributes
\theta^{-nm}\exp\bigl(-(\textstyle\sum_i x_i)/\theta\bigr).
The prior contributes
\theta^{-\alpha_0-1}\exp(-\beta_0/\theta).
Hence
\boxed{\theta\mid{\boldsymbol{x}} \sim\operatorname{InvGamma}(\alpha_0+nm,\;\beta_0+\textstyle\sum_i x_i).}
(iii) For \alpha_0+nm>1,
\mathbb{E}(\theta\mid{\boldsymbol{x}}) = \frac{\beta_0+\sum x_i}{\alpha_0+nm-1} = \frac{(\alpha_0-1)\,\mathbb{E}(\theta)+nm\,\hat\theta}{(\alpha_0-1)+nm}.
Writing the mean explicitly as a convex combination gives
\mathbb{E}(\theta\mid{\boldsymbol{x}}) =\underbrace{\frac{\alpha_0-1}{\alpha_0+nm-1}}_{w_0}\mathbb{E}(\theta) +\underbrace{\frac{nm}{\alpha_0+nm-1}}_{w_n}\hat\theta.
For \alpha_0>1, both weights are nonnegative and w_0+w_n=1. The data contribution is nm, the total number of captured animals across the n locations.
(iv) With n and the prior fixed, m\to\infty makes w_0\to0 and w_n\to1. If \hat\theta=\bar x/m remains bounded, as it does in probability under the stated sampling model at a fixed true scale, the posterior mean approaches \hat\theta.
(v) Taking \alpha_0,\beta_0\to0 in the posterior expression gives \sum_i x_i/(nm-1)=\{nm/(nm-1)\}\hat\theta, provided nm>1. It is close to, but not exactly, the MLE. This is a formal weak-prior limit: the proper inverse-gamma prior’s mean does not exist along the path once \alpha_0\leq1, so the weighted-average formula involving that mean cannot be used to take this limit.
(vi) When \alpha_0>1, the hyperparameters act like prior information that pulls the MLE toward the prior mean \beta_0/(\alpha_0-1), with weight w_0. In the posterior-mean ratio, \alpha_0-1 plays a pseudo-count role beside the observed nm, and \beta_0 plays a prior total-waiting-time role beside \sum_i x_i. These need not represent literal extra animals.
(vii) Let a=\alpha_0+nm and b=\beta_0+\sum x_i. The central credible interval is the \alpha/2 and 1-\alpha/2 quantiles of \operatorname{InvGamma}(a,b).
Equivalently, let q_u be the u-quantile of \operatorname{Gamma}(a,b) in shape–rate form. Since 1/\theta has this gamma posterior, the interval is [1/q_{1-\alpha/2},1/q_{\alpha/2}]. The reversal of endpoints follows because taking reciprocals is decreasing. Conditional on the data and model, the interval contains posterior probability 1-\alpha; it describes uncertainty about the common scale, not the waiting time of a future animal.