# Name of rv that results from integrating over gamma in gamma product prior on poisson

If $d$ is an arbitrary random variable with parameter(s) $\Psi$ and positive support, $g \sim \mathrm{Gamma}(\alpha, \beta)$, $x \sim \mathrm{Poisson}(gd)$, and $g$ and $d$ are independent, then

\begin{align*} \mathbb{P}(x\text{ }|\text{ }d; \alpha, \beta, \Psi) &\propto \mathbb{P}(x, d; \alpha, \beta, \Psi)\\ &= \int_{\mathbb{R}^+} \mathrm{d}g\text{ }\mathbb{P}(x, d, g; \alpha, \beta, \Psi)\\ &= \mathbb{P}(d; \Psi) \int_{\mathbb{R}^+} \mathrm{d}g\text{ }\mathbb{P}(x \text{ }|\text{ } g, d)\mathbb{P}(g; \alpha, \beta)\\ &\propto \int_{\mathbb{R}^+} \mathrm{d}g\text{ }\mathbb{P}(x \text{ }|\text{ } g, d)\mathbb{P}(g; \alpha, \beta)\\ &= \int_{\mathbb{R}^+} \mathrm{d}g\text{ } \frac{(gd)^{x}}{x!}\exp\left[-gd\right] \frac{\beta^{\alpha}}{\Gamma(\alpha)}g^{\alpha-1}\exp\left[-\beta g\right]\\ &= \frac{d^x \beta^\alpha}{x!\Gamma(\alpha)} \int_{\mathbb{R}^+} \mathrm{d}g\text{ } g^{x+\alpha-1}\exp\left[-g(d+\beta)\right]\\ &= \frac{d^x \beta^\alpha}{x!\Gamma(\alpha)} \frac{\Gamma(x+\alpha)}{(d+\beta)^{x+\alpha}}\\ &= \frac{\Gamma(x+\alpha)}{\Gamma(x+1)\Gamma(\alpha)} \frac{d^x \beta^\alpha}{(d+\beta)^{x+\alpha}}\\ \end{align*}

As one might expect from the fact that the gamma-poisson mixture distribution is the negative binomial distribution, the above unnormalized PMF looks eerily like the negative binomial PMF. Indeed, if $d$ has support on $(0,1)$---e.g. if $d$ is beta distributed---and $g$ is made dependent on $d$ by setting $\beta \equiv 1-d$, the above just is $\mathrm{NegativeBinomial(x; \alpha, d)}$.

So my question is, what kind of random variable is $x \text{ }|\text{ }d, \alpha, \beta$ in either the arbitrary positive case or in the case where $d$ has support on $(0,1)$?

Since $d$ has positive support and $\beta \gt 0$, the ratio $p=d/(d+\beta)$ almost surely lies in the interval $(0,1)$. Then
$$\mathbb{P}(x; d,\alpha,\beta)=\frac{\Gamma(x+\alpha)}{\Gamma(x+1)\Gamma(\alpha)} \frac{d^x \beta^\alpha}{(d+\beta)^{x+\alpha}} = \binom{x+\alpha -1}{\alpha -1}\left(1-p\right)^\alpha\,p^{x}$$
is the PDF of a Negative Binomial distribution with parameters $(\alpha, p)$.