Question 8. Exponential versus gamma lifetimes

The lifetimes of n devices are {\boldsymbol{x}}=(x_1,\ldots,x_n). Two models are proposed,

M_1\colon X\sim\operatorname{Exp}(\lambda), \qquad M_2\colon X\sim\operatorname{Gamma}(3,\theta),

with priors \lambda\sim\operatorname{Gamma}(1,3) and \theta\sim\operatorname{Gamma}(1,1). Gamma and exponential distributions use the shape–rate sheet: a \operatorname{Gamma}(3,\theta) density is \theta^{3}x^{2}e^{-\theta x}/2.

(i) Find the marginal likelihood f({\boldsymbol{x}}\mid M_1). [6 marks]

(ii) Find the marginal likelihood f({\boldsymbol{x}}\mid M_2). [6 marks]

(iii) Obtain BF_{12}=f({\boldsymbol{x}}\mid M_1)/f({\boldsymbol{x}}\mid M_2). For these data BF_{12}=1.347. Interpret this number and state which model it prefers. [4 marks]

(iv) The researchers believe M_2 is three times as likely as M_1 a priori. What are the posterior odds? Which model is preferred? [4 marks]

Definitions. Write S=\sum_i x_i and Q=\prod_i x_i^2. Both \lambda and \theta are rates. The marginal likelihood f({\boldsymbol{x}}\mid M_k) is the prior predictive density of the entire observed sample under model M_k. The Bayes factor BF_{12} is the ratio of these densities, in the stated order.

A marginal likelihood integrates the normalised likelihood against the normalised parameter prior, so factors involving only the data must be retained. Both integrations use \int_0^\infty t^{A-1}e^{-Bt}\,dt=\Gamma(A)/B^A for A,B>0. This identity follows by setting u=Bt in the defining gamma integral.

(i) The \operatorname{Exp}(\lambda) likelihood is \lambda^{n}e^{-\lambda\sum x_i}, and the \operatorname{Gamma}(1,3) prior density is 3e^{-3\lambda}. Hence

f({\boldsymbol{x}}\mid M_1) = 3\int_0^{\infty}\lambda^{n}e^{-\lambda(\sum x_i+3)}\,d\lambda = \boxed{\dfrac{3\,n!}{\bigl(3+\sum_{i=1}^{n}x_i\bigr)^{n+1}}.}

(ii) A \operatorname{Gamma}(3,\theta) observation has density \theta^{3}x^{2}e^{-\theta x}/2. The prior density of \theta is e^{-\theta}. Therefore

\begin{aligned} f({\boldsymbol{x}}\mid M_2) &= \frac{\prod_{i=1}^{n}x_i^{2}}{2^{n}} \int_0^{\infty}\theta^{3n}e^{-\theta(\sum x_i+1)}\,d\theta\\ &= \boxed{\dfrac{\bigl(\prod_{i=1}^{n}x_i^{2}\bigr)\,\Gamma(3n+1)}{2^{n}\bigl(1+\sum_{i=1}^{n}x_i\bigr)^{3n+1}}.} \end{aligned}

(iii) Substituting (i) and (ii) into BF_{12}=f({\boldsymbol{x}}\mid M_1)/f({\boldsymbol{x}}\mid M_2) gives

\boxed{BF_{12} =\frac{3\,2^n\Gamma(n+1)(S+1)^{3n+1}} {\Gamma(3n+1)(S+3)^{n+1}Q}.}

For the observed sample this is 1.347: the marginal likelihood under M_1 is 1.347 times that under M_2. The data therefore favour M_1, but only slightly. The Bayes factor is not a posterior model probability.

For a continuous sample these are densities, not probabilities of the exact observed vector. Their ratio compares how strongly the two prior predictive distributions support the same observed data. Optimising each likelihood and taking the ratio would instead compare maximised likelihoods and would not calculate this Bayes factor.

(iv) Prior odds of M_1 to M_2 are 1/3. Posterior odds of M_1 to M_2 are BF_{12}/3=1.347/3=0.449:1, or about 2.23:1 in favour of M_2. Thus M_2 is preferred once the prior odds are included.

The governing identity is posterior odds = Bayes factor \times prior odds. The data shift the odds towards M_1, but the shift is too small to overcome the prior preference for M_2. If these are the only two models under consideration, their posterior probabilities are approximately 0.310 and 0.690, respectively.