# Finding the posterior distribution, several priors

Bayes' rule $$\pi(\theta|y)\propto\pi(y|\theta)\pi(\theta)$$ gives the posterior distribution. However for the first time I have encountered a problem where I have two parameters (because the likelihood function is a gamma distribution), $\alpha$ and $\beta$.

• I know the likelihood function (a gamma distribution).
• I know the distribution for $\beta$ given that $\alpha$ is known (a gamma distribution).
• I know the distribution of $\alpha$ (an exponential distribution).
• I have data $y$.

The goal is to find the posterior distribution. In general, how do I approach a problem like this? How can I find the the prior when the prior is given as two separate distributions and one depends on the other?

You can use the product rule $P(A, B) = P(A) P(B | A)$ to figure this out.
You can similarly expand the left-hand side into $\pi(\alpha, \beta \, | \, y) \pi(y)$, and then dividing everything by the latter term gives you Bayes' theorem.