Is there a standard name for a situation where a random variable follows a distribution whose parameter is another random variable ? For example a binomial(15,p) variable where the the p is distributed as beta(1,2), or a Poisson(Y) where Y is distributed as exponential(2)
Is this called a compound distribution, or ?
Then my real question is, given Y is distributed according to some given pdf with parameter X (say pdf1), but X is distributed according to another distribution (say pdf2), how do I use Bayes rule:
$$
f_{X|Y}(x|y)=\frac{f_{Y|X}(y|x) \, f_X(x)}{f_Y(y)}
$$
?
$f_X(x)$ must just be pdf2, right ?
Is $f_{Y|X}(y|x)$ just the pdf of Y (that is, pdf1) with the pdf of X substituted in place of X ?
How do I work out $f_Y(y)$ ?
I hope it isn't asking too much for someone to tell me the general approach and also give an example of this, not necessarily one of those I mentioned above.
I have looked in several statistics books but I didn't find the answer.