1

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!

Anna
  • 11
  • 2
  • 1
    Please explain what you mean by "But can't simply divide." Isn't that precisely what $Z=X/Y$ tells you to do? – whuber Sep 01 '15 at 13:34
  • I mean, I cannot draw a sample from X and a sample from Y and divide the observations in the sample afterwards. – Anna Sep 02 '15 at 06:11
  • Maybe I'm wrong with this statement? I tried it with $X\sim N(0,1)$ and $Y\sim \Chi_n^2$, where it is known that $\frac{X}{\sqrt{Y/n}}\sim t_n$, and compared the samples. It seems to work. – Anna Sep 02 '15 at 08:25

0 Answers0