TITLE: compound of gamma and exponential distribution
QUESTION [7 upvotes]: What is the distribution of a exponential distribution, whose parameter is drawn form the gamma distribution
$$ X \sim \operatorname{Gamma}(\alpha,\beta)$$
$$ Y \sim \operatorname{Exp}(X)$$
how is $Y$ distributed?
EDIT
Since there are different ways of expressing the gamma distribution I will state the distributions that lead to heropup's correct answer.
the pdf of the gamma distributed variable $X$ is given by
$$f_X(x) = \frac {\beta^{\alpha}}{\Gamma (\alpha)} x^{\alpha -1} e^{-\beta x}$$
and the pdf of the compound exponenetial variable $Y$ is given by
$$f_{Y\mid X}(y\mid x) = Xe^{-Xy}$$

REPLY [9 votes]: If $X$ and $Y \mid X$ are parametrized in terms of rate, then the marginal distribution of $Y$ can be computed by observing $$\begin{align*} f_Y(y) &= \int_{x=0}^\infty f_{Y \mid X}(y \mid x) f_X(x) \, dx \\ &= \int_{x=0}^\infty x e^{-x y} \frac{\beta^\alpha x^{\alpha-1} e^{-\beta x}}{\Gamma(\alpha)} \, dx \\ &= \frac{\beta^\alpha}{\Gamma(\alpha)} \int_{x=0}^\infty x^{\alpha} e^{-(y+\beta)x} \, dx \\ &= \frac{\beta^\alpha \Gamma(\alpha+1)}{\Gamma(\alpha)(y+\beta)^{\alpha+1}} \int_{x=0}^\infty \frac{(y+\beta)^{\alpha+1} x^{\alpha} e^{-(y+\beta)x}}{\Gamma(\alpha+1)} \, dx \\ &= \frac{\alpha\beta^\alpha}{(y + \beta)^{\alpha+1}} . \end{align*}$$  This is a (shifted) Pareto distribution on $Y \in [0, \infty)$.