# Generating Random Samples According to Gamma-Exponential Distribution

Suppose that we have a multivariate Gamma-Exponential Distribution with pdf $$p(x,y) = \frac{{{\theta _1}^{{\theta _2}}{\theta _3}}}{{\Gamma ({\theta _2})}}{x^{{\theta _2}}}{e^{ - {\theta _1}x - {\theta _3}xy}}$$

How can I generate random samples according to this distribution?

-
@MahdiKhosravi Changing the size of the fonts is not desirable in general (and certainly not in the present case). Surely you can find more constructive ways to contribute? – Did Jul 28 '13 at 7:17

If you divide $p(x,y)$ by $\theta_3 x e^{-\theta _3x y}$, you would get $\frac{e^{-x \theta _1} x^{+\theta_2 - 1} \theta _1^{\theta _2}}{\Gamma\left(\theta _2\right)}$ which immediately shows that the marginal for $X$ is gamma with parameters $\theta_1$ and $\theta_2$ and that the conditional of $Y$ given $X=x$ is exponential with parameter $x\theta_3$. To sample from $p(x,y)$, start by sampling $X$ from a gamma distribution with parameters $\theta_1$ and $\theta_2$ and then sample an exponential for $Y$ with parameter given the the sampled value of $X$ multiplied by $\theta_3$. Repeat that as many times as the required random sample is.