I am trying to compute the distribution of a uniform distribution whose upper limit is drawn from a gamma distribution.
That is,
$X \sim \Gamma(\alpha,\beta)$
$Y \sim U(0,X)$
We know:
$$f_X(x)={\beta^\alpha \over \Gamma(\alpha)} x^{\alpha-1} e^{-\beta x}$$
and
$$f_{Y\mid X}(y\mid x) = \begin{cases} {1\over X} & 0 \le y \le X, \\ 0 & \text{otherwise}, \end{cases} $$
but I get lost at the integral
$$f_Y(y) = \int_{x=0}^\infty f_{Y\mid X}(y\mid x) f_X(x)\,dx$$
I'm embarrassed to ask because I think the answer must be simple. But it's been too long since I've done this. I get:
$$f_Y(y)=\int_{x=0}^{x=\Gamma^{-1}(y)} 1\, dx = \Gamma^{-1}(y)$$
but I don't think that's right. Please help! I'm a neuroscientist and I'm trying to understand a distribution I've measured.