1
$\begingroup$

I'm reading about Gibbs sampling from a paper by Casella and George and in an example I'm given the following joint distribution for random variables $X$ and $Y$:

$$f(x,y)\propto \left(\begin{array}n n\\ x\end{array}\right)y^{x+\alpha-1}(1-y)^{n-x+\beta-1}$$

where $x=0,1,\dots,n,\;\;0\leq y\leq 1$. I'm also given in my reference that

$$f(x)=\left(\begin{array}n n\\ x\end{array}\right)\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}\frac{\Gamma(x+\alpha)\Gamma(n-x+\beta)}{\Gamma(\alpha+\beta+n)}$$

$x=0,1,\dots,n$ and that by supressing the overall dependence on $n,\alpha$ and $\beta$ we get that

  1. $f(x\mid y)$ is Binomial $(n,y)$ and
  2. $f(y\mid x)$ is Beta $(x+\alpha, n-x+\beta)$.

How do we arrive in these solutions, i.e. how to calculate $f(x), f(x\mid y)$ and $f(y\mid x)$?

$\endgroup$

2 Answers 2

2
$\begingroup$

Any $f(x,y)$ can be written in the form $$f_{X,Y}(x,y)=Ku(x)w(y)φ(x,y)\tag{1}$$ where $K$ is a constant (with respect to $x,y$) and $u,w,φ$ are any functions. Now observe that $$f_{Y\mid X}(y\mid X=x)=\frac{f_{X,Y}(x,y)}{f_X(x)}=\frac{Ku(x)w(y)φ(x,y)}{Ku(x)\int_{\Bbb R}w(y)φ(x,y)\; dy}=cw(y)φ(x,y)$$ where $c$ is a new constant (with respect only to $y$ though!). Hence $$f_{Y\mid X}(y\mid X=x)\propto w(y)φ(x,y)$$ which means that you can "recognize the distribution of $Y\mid X=x$ by inspection of $w(y)$ and $φ(x,y)$". Similarly for $f_{X\mid Y}$. To see this in practice, write $f_{X,Y}(x,y)$ in the form of $(1)$: $$f_{X,Y}(x,y)\propto \underbrace{\dbinom{n}{x}}_{=u(x)}\underbrace{y^{α+1}(1-y)^{β-1}}_{=w(y)}\underbrace{y^x(1-y)^{n-x}}_{=φ(x,y)}$$ Based on the above \begin{align}f_{Y\mid X}(y\mid X=x)&\propto w(y)φ(x,y)\propto y^{x+α-1}(1-y)^{n-x+β-1}\tag{2}\\[0.2cm]f_{X\mid Y}(x\mid Y=y)&\propto u(x)φ(x,y)\propto \dbinom{n}{x}y^{x}(1-y)^{n-x}\tag{3}\end{align} Now from $(3)$ it must be immediate that $X\mid Y=y \sim {\rm Bin}(n,y)$ and from $(2)$ (perhaps with some more experience with Beta distribution) that $Y\mid X=y \sim {\rm Beta}(x+a,n-x+β)$. Having all these, calculate $f_X(x)$ as $$f_X(x)=\frac{f_{X,Y}(x,y)}{f_{Y\mid X}(y\mid X=x)}$$

$\endgroup$
3
  • 2
    $\begingroup$ Thank you for your help, appreciate it. The example in the paper was supposed to be simple, but as a newcomer this was not obvious to me at all. $\endgroup$
    – jjepsuomi
    Apr 4, 2016 at 13:13
  • 1
    $\begingroup$ No, this in indeed not obvious. This is something you usually get explained it should not be expected that you come up with it by yourself. $\endgroup$
    – Jimmy R.
    Apr 4, 2016 at 13:54
  • 2
    $\begingroup$ Thank you again for your explanation! =) helped me a lot. $\endgroup$
    – jjepsuomi
    Apr 5, 2016 at 7:48
2
$\begingroup$

To find the density of $f(x)$ (marginal density) you can use $$f_{\mbox{temp}}(x) = \int_{0}^{1} \binom{n}{x}y^{x+\alpha-1} (1-y)^{n-x+\beta-1}dy. \quad (*)$$ To solve the above integral, you can make use of the beta-function $$\beta(x,y) = \int_{0}^{1} t^{x-1}(1-t)^{y-1}dt.$$ Note that since you do not have an exact form for the joint density (because of the $\propto$) you'll have to find a constant $c$ such that $\sum_{x=0}^{n} c f_{\mbox{temp}}(x) = 1$. Hence, $f(x) = c f_{\mbox{temp}}(x)$. Consequently, by applying the formula $$f_{Y \ | \ X}(y \ | \ X = x) = \frac{f_{X,Y}(x,y)}{f_X(x)},$$ you can find the conditional distribution of $Y$.

$\endgroup$
1
  • 1
    $\begingroup$ Thank you for your help! Appreciate it :) $\endgroup$
    – jjepsuomi
    Apr 4, 2016 at 13:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .