2
$\begingroup$

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?

$\endgroup$
5
  • 2
    $\begingroup$ If you have a functional form for the full conditionals and identify a standard distribution as here, the normalising constants are automatically deduced. $\endgroup$
    – Xi'an
    Dec 2, 2014 at 13:38
  • 1
    $\begingroup$ 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. $\endgroup$
    – Xi'an
    Dec 2, 2014 at 13:40
  • $\begingroup$ 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) $\endgroup$ Dec 2, 2014 at 13:46
  • $\begingroup$ Why $\beta ^{\alpha}$ and $\gamma(\alpha)$?? I though they were constants and are absorved with the $\propto$ sign $\endgroup$ Dec 2, 2014 at 13:51
  • 2
    $\begingroup$ 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$. $\endgroup$
    – Xi'an
    Dec 2, 2014 at 15:03

1 Answer 1

2
$\begingroup$

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$.

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$ Dec 5, 2014 at 8:18
  • 1
    $\begingroup$ 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))$. $\endgroup$
    – Xi'an
    Dec 5, 2014 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.