# Problem expressing full conditionals

I have this problem,

$Y_{i}$~Gamma($\alpha$,$\beta$) 1...N
$\alpha$~Exp($\lambda$)
$\beta$~Exp($\lambda$)

$\lambda$=0.001,Find the full conditionals.

I have done the following:
p($\theta$|Y)$\propto$p(Y|$\theta$)p($\theta$) = $\prod_{i}^N Y_{i}^{\alpha-1} e^{-\beta Y_{i}} \lambda e^{\lambda \alpha} \lambda e^{-\lambda \beta}$
= $\prod_{i}^N Y_{i}^{\alpha-1} e^{-\beta Y_{i}} \lambda^{2} e^{-(\lambda \beta+\lambda \alpha)}$
= $\prod_{i}^N \lambda^{2} Y_{i}^{\alpha-1} e^{-(\lambda \beta+\lambda \alpha+\beta Y_{i})}$

Then
p($\alpha$|$\beta ,Y)$$\propto Y_{i}^{\alpha-1}e^{-\lambda \alpha} p(\beta|\alpha ,Y)\propto$$ e^{-(\lambda + \sum_{1}^{N}{Y_{i}})\beta}$

Now these look like a gamma and exponential, but I'm having problems adding the normalizing constants or expressing them as the functions, Gamma($\alpha, \lambda \alpha$) and Exp($\lambda + \sum_{1}^{N}{Y_{i}}$)?. Any help?

• If you have a functional form for the full conditionals and identify a standard distribution as here, the normalising constants are automatically deduced. Dec 2, 2014 at 13:38
• You forgot a term in $\beta$, $\beta^\alpha$, and a term in $\alpha$, $\Gamma(\alpha)$, in $p(y|\theta)$. The proportionality sign means proportional as a function of $\theta$, hence all terms depending on $\alpha$ and $\beta$ should remain. Dec 2, 2014 at 13:40
• Yes, but what is the proportionality constant from a Gamma($\alpha, \lambda \alpha$) is this the correct way to express it? I see it is a gamma but I'm not sure of the correct way of putting gamma(a,b) Dec 2, 2014 at 13:46
• Why $\beta ^{\alpha}$ and $\gamma(\alpha)$?? I though they were constants and are absorved with the $\propto$ sign Dec 2, 2014 at 13:51
• This is exactly why I wrote what I wrote: when expressed as $p(\theta|y)\propto p(\theta)p(y|\theta)$, you cannot removed from the rhs multiplicative terms that depend on $\theta$, such as $\Gamma(\alpha)$ and $\beta^\alpha$. Dec 2, 2014 at 15:03

The joint distribution of "everything" $(y_1,\ldots,y_N,\alpha,\beta)$ is $$\prod_{i}^N \left\{ \dfrac{\beta^\alpha y_{i}^{\alpha-1}}{\Gamma(\alpha)} \right\} e^{-\beta y_{i}} \lambda^{2} e^{-(\lambda \beta+\lambda \alpha)}\,,$$ incorporating all "constants". Therefore, if we only take the terms that involve $\alpha$ in the above we find: $$\beta^{N\alpha} e^{-\lambda \alpha} \Gamma(\alpha)^{-N} \prod_{i}^N y_{i}^{\alpha-1} = \Gamma(\alpha)^{-N} \exp\left\{ N\alpha\log(\beta) +\sum_{i=1}^N (\alpha-1)\log(y_i) -\lambda\alpha \right\}$$ meaning that $$p(\alpha|y_1,\ldots,y_N,\beta,\lambda) \propto \Gamma(\alpha)^{-N} \exp\left\{ -\alpha \left[\lambda-N\log(\beta)-\sum_{i=1}^N \log(y_i) \right] \right\}$$ which is not a standard distribution...
Similarly, if we extract all terms that depend on $\beta$ from the joint, we obtain $$\beta^{N\alpha} e^{-\lambda \beta} \prod_{i}^N e^{-\beta y_{i}}$$ that is, $$p(\beta|y_1,\ldots,y_N,\alpha,\lambda) \propto \beta^{N\alpha} \exp\left\{ -\beta\left[\lambda +\sum_{i=1}^N y_i \right] \right\}\,.$$ As a function of $\beta$, this is proportional to the Gamma density $$\mathcal{G}a\left(N\alpha+1,\lambda +\sum_{i=1}^N y_i\right)$$ and hence this Gamma is the full (conditional) posterior distribution of $\beta$.
• Thanks, I see it now. But, could you tell me how did you got the $\log$ there I have the $\prod$ still for $\alpha$. Thanks. Dec 5, 2014 at 8:18
• I edited one formula to "explain the log there" although I am not sure why it is unclear: $y_i^\alpha=\exp(\alpha\log(y))$. Dec 5, 2014 at 11:37