# Thread: Joint distrib of gamma distribs

1. ## Joint distrib of gamma distribs

Let X_i, with i \epsilon {1,2,3} be independant r.v. and suppose that X_i \epsilon Gamma(r_i,1).
Now set:
Y_1= X_1/(X_1+X_2)
Y_2= (X_1+X_2)/(X_1+X_2+X_3)
Y_3= X_1+X_2+X_3

Determine the joint distrib of Y_1, Y_2, Y_3.

What is the best strategy to tackle this problem? rewrite X_i in Y_i and try to find a jacobian? I tried that but i got some divided by 0 in it.

(answer: f_\vec{y}(\vec{y})=1/(gamma(r_1)*gamma(r_2)*gamma(r_3))*y_1^{r_1-1}*y_2^{r_1+r_2-1}*y_3^{r_1+r_2+r_3-1}*(1-y_1)^{r_2-1}*(1-y_2)^{r_3-1}*exp(-y_3) with 0<y_1<1, 0<y_2<1 and y_3>0 )

im sorry about the notation but i did not get the mathmode to work...

2. Yeah, the Jacobian should work. I don't see where a divided by 0 has an opportunity to occur, but man the det of the Jacobian matrix doesn't look very fun to compute or work with. You should end up with

$X_1 = Y_1 Y_2 Y_3$
$X_2 = Y_2 Y_3 - Y_1 Y_2 Y_3$
$X_3 = Y_3 - Y_2 Y_3$

[assuming I did this right]

Update: Yep, just finished it and this works. It works out super nice, particularly the Jacobian simplifies to $Y_2 Y_3 ^2$ and it happens to be exactly what you need. They're independent, weird o.O I'm guessing you can extend this result to an arbitrary number of independent gammas.

3. Originally Posted by theodds
They're independent, weird o.O I'm guessing you can extend this result to an arbitrary number of independent gammas.
If I may add a piece of explanation.

This, and its generalization, are consequences of two simpler and widely known facts (perhaps previous questions?):
If $X,Y$ are independent random variables respectively distributed according to $\Gamma(\alpha,1)$ and $\Gamma(\beta,1)$, then
a) $X+Y$ has $\Gamma(\alpha+\beta,1)$ distribution
b) $\frac{X}{X+Y}$ has $B(\alpha,\beta)$ distribution and is independent of $X+Y$.

Then you use these properties several times: if $X_i$, $1\leq i\leq n$ are independent random variables with respective distributions $\Gamma(r_i,1)$, $1\leq i\leq n$, then:
- $\frac{X_1}{X_1+X_2}$ is $B(r_1,r_2)$ distributed and independent of $X_1+X_2$ (and of $X_3,\ldots,X_n$)
- $Y_2=X_1+X_2$ is $\Gamma(r_1+r_2,1)$ distributed, hence you can repeat the first step to the sequence $(Y_2,X_3,X_4,\ldots,X_n)$: $\frac{Y_2}{Y_2+X_3}$ is $B(r_1+r_2,r_3)$ distributed and independent of $Y_3=Y_2+X_3=X_1+X_2+X_3$, which is $\Gamma(r_1+r_2+r_3,1)$ distributed.
- and so on.

4. That also would make the problem much easier. I saw that the 2nd and 3rd were independant gamma and beta based on (a) and (b) above, but I figured you'd only be able to get pairwise independance of those two.