I want to sample from a random variable $Z=\frac{X}{Y}$, where $X$ and $Y$ are mixtures of distributions. I figured out, how to sample from a mixture distribution (e.g. Generating random variables from a mixture of Normal distributions). But can't simply divide the resulting two samples. How can I do this with R? Or is it maybe also possible to use WinBUGS?
As an example the following distributions can be used:
$f_X=0.4*Gamma(2,2) + 0.6*Gamma(26,8)$ and $f_Y=0.4*Gamma(2,3) + 0.2*Gamma(26,8) + 0.4*Gamma(2,0.5)$
the second parameter is the rate parameter. I couldn't figure out how to do this with the acceptance-rejection method... An algorithm would be great, writing an R code should be then no problem.
Thank you in advance!