Solved – Finding posterior distribution, for gamma prior, and gamma sampling distribution with known shape parameter

bayesian

Let $\{y_i:i=1,…n\}$ be a random sample from $Ga(\theta,2)$, and the prior for $\theta$ is also from a $Ga(\bar{\theta},\nu)$. I'm using the $scale=\theta$, $shape=2$ parametrization.

$f(y_i|\theta,2)=\frac{1}{\Gamma(2)\theta^2}y_i^{2-1}e^{-y_i/\theta}$, for $y_i>0$.

I'm trying to find the posterior density $f(\theta|y)$. However, what I get is $f(\theta|y) \propto \theta^{\nu -2n-1}\ e^{-\sum y_i /\theta – \theta/\bar{\theta}}$.

I know that this is supposed to be a gamma, but I do not see how I can work with the power of the exponential to get what we need for it to be a gamma…

EDIT: If I use the rate/shape parametrization, $f(y_i|\theta,2)=\frac{\theta^2}{\Gamma(2)}y_i^{2-1}e^{-y_i\theta}$, I can easily get a posterior gamma. This seems to be dependent on the parametrization ?!

Best Answer

This issue is connected with the two ways of parametrising the second parameter θ of a Gamma $\mathcal{G}(\nu,\theta)$ distribution, scale versus rate.

If the rate θ is unknown, and if you have a sampling density of the form $$f(x|θ,ν)=\dfrac{θ^νx^{ν−1}}{Γ(ν)}\exp\{−θx\}\,,$$ the conjugate prior is $\theta\sim\mathcal{G}(\alpha,\beta)$ with posterior $$\theta|x\sim \mathcal{G}(\alpha+\nu,\beta+x)$$

Or the scale $\theta$ is unknown, with sampling density of the form $$f(x|θ,ν)=\dfrac{θ^{-ν}x^{ν−1}}{Γ(ν)}\exp\{−x/θ\}$$ then the conjugate prior is inverse Gamma, meaning that $\theta^{-1}$ is a $\mathcal{G}(\alpha,\beta)$ variable. The posterior is then again an inverse Gamma, with parameters $\alpha+\nu$ and $\beta+x$, exactly as above! Which makes perfect sense when realising this is just a matter of reparameterisation!