Ratio of Gamma distributed variables

Having inferred the two rates, we can now evaluate the distribution of $\rho=r_1/r_2$, which is technically just a problem of `direct probabilities', that is getting the pdf $f(\rho\,\vert\,x_1,T_1,x_2,T_2)$ from $f(r_1\,\vert\,x_1,T_1)$ and $f(r_2\,\vert\,x_2,T_2)$ (the Bayesian network that relates the variables of interest is shown in Fig. [*]).
Figure: Graphical model relating the physical quantities (rates and measurement times) to the observed numbers of events.
\begin{figure}\begin{center}
\epsfig{file=two_rates_rho_1.eps,clip=,width=0.6\linewidth}
\\ \mbox{}\vspace{-0.8cm}\mbox{}
\end{center}
\end{figure}
We just need to repeat what it has been done in Sec. [*], taking the advantage of having understood that $f(\lambda_1\,\vert\,x_1)$ and $f(\lambda_2\,\vert\,x_2)$ appearing in Eq. ([*]) are indeed Gamma distributions. Therefore, we start evaluating the probability distribution of the ratio of generic Gamma variables, denoted as $Z_1$ and $Z_2$ (and their possible occurrences $z_1$ and $z_2$) in order to avoid confusion with $X$'s, associated so far to measured counts:
$\displaystyle Z_1\!\!$ $\displaystyle \sim$ $\displaystyle $   Gamma$\displaystyle (\alpha_1,\beta_1)$ (52)
$\displaystyle Z_2\!\!$ $\displaystyle \sim$ $\displaystyle $   Gamma$\displaystyle (\alpha_2,\beta_2)\,.$ (53)

The pdf of $Z_1/Z_2$ is the given by
$\displaystyle f(\rho_z\,\vert\,\alpha_1,\beta_1,\alpha_2,\beta_2)\!\!$ $\displaystyle =$ $\displaystyle \int_0^\infty\!\!\!\int_0^\infty\!
\delta\!\left(\rho_z-\frac{z_1...
...ot\!
f(z_1\,\vert\,\alpha_1,\beta_1)\!\cdot\! f(z_2\,\vert\,\alpha_2,\beta_2)\,$   d$\displaystyle z_1$   d$\displaystyle z_2\,,\ \ \ \ \ \ $ (54)

in which we have indicated by $\rho_z$ their ratio. In detail, taking benefit of what we have learned in Sec. [*],
$\displaystyle f(\rho_z\,\vert\,\ldots)\!\!$ $\displaystyle =$ $\displaystyle \int_0^\infty\!\!\!\int_0^\infty\!\!\!
z_2\cdot \delta(z_1\!-\!\r...
...,\alpha_2}\cdot z_2^{\,\alpha_2-1}\cdot e^{-\beta_2\,z_2}}{\Gamma(\alpha_2)}
\,$   d$\displaystyle z_1$   d$\displaystyle z_2$  
$\displaystyle $ $\displaystyle =$ $\displaystyle \frac{\beta_1^{\,\alpha_1}\beta_2^{\,\alpha_2}}
{\Gamma(\alpha_1)...
...eta_1\,(\rho_z\cdot z_2)}}
\cdot {z_2^{\,\alpha_2-1}\cdot e^{-\beta_2\,z_2}}
\,$   d$\displaystyle z_2$ (55)
$\displaystyle $ $\displaystyle =$ $\displaystyle \frac{\beta_1^{\,\alpha_1}\cdot \beta_2^{\,\alpha_2}}
{\Gamma(\al...
...!\! z_2^{\,\alpha_1+\alpha_2-1}\cdot
e^{-(\beta_2+\rho_z\,\beta_1)\cdot z_2}
\,$   d$\displaystyle z_2\,.$ (56)

Writing $\alpha_1\! +\! \alpha_2$ as $\alpha_*$ and $\beta_2\!+\!\rho_z\!\cdot\! \beta_1$ as $\beta_*$, we get
$\displaystyle f(\rho_z\,\vert\,\alpha_1,\beta_1,\alpha_2,\beta_2)\!\!$ $\displaystyle =$ $\displaystyle \frac{\beta_1^{\,\alpha_1}\cdot \beta_2^{\,\alpha_2}}
{\Gamma(\al...
...,\alpha_1-1}
\int_0^\infty\!\!\! z_2^{\alpha_*-1}\cdot
e^{-\beta_*\cdot z_2}
\,$   d$\displaystyle z_2$ (57)
  $\displaystyle =$ $\displaystyle \frac{\beta_1^{\,\alpha_1}\cdot \beta_2^{\,\alpha_2}}
{\Gamma(\al...
...2)}\cdot
\rho_z^{\,\alpha_1-1}\cdot \frac{\Gamma(\alpha_*)}{\beta_*^{\alpha_*}}$ (58)
  $\displaystyle =$ $\displaystyle \frac{\Gamma(\alpha_1+\alpha_2)}
{\Gamma(\alpha_1)\cdot \Gamma(\a...
...c{ \rho_z^{\,\alpha_1-1}}{(\beta_2+\rho_z\!\cdot\beta_1)^{\,\alpha_1+\alpha_2}}$ (59)
  $\displaystyle =$ $\displaystyle \frac{\Gamma(\alpha_1+\alpha_2)}
{\Gamma(\alpha_1)\cdot \Gamma(\a...
...dot\! (\beta_2+\rho_z\!\cdot\beta_1)^{\,-(\alpha_1+\,\alpha_2)}\!. \ \ \ \ \ \ $ (60)



Subsections