Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two i.i.d. random variables $X$ and $Y$ and I want to generate a set of $n$ random samples from the distribution of the ratio between the two variables $Z=X/Y$.

The pdf of $Z$ is described by: $$ f_Z(t) = \int_{-\infty}^\infty |u| ~ f_{X,Y}(tu,u)~\mathrm{d} u, $$ and then its cdf: $$ F_Z(t) = \int_{-\infty}^t f_Z(u)~\mathrm{d} u. $$ Then, in theory I can generate random samples $z\sim Z$ by: $$ z=F^{-1}_Z(r), $$ where $r$ is a uniform random sample in $[0,1]$.

The problem is that obtaining $f_Z(t)$ is not straightforward, specially when $X$ and $Y$ are both Weibull distributions; neither it is to obtain $F_Z(t)$. Is there any way to obtain random samples from $Z$ by directly using random samples from the marginal distributions of $X$ and $Y$ ?

share|cite|improve this question
I presume by "random samples from $X$ and $Y$" you mean separate random samples from their marginal distributions? If you mean samples of $X$ and $Y$ together from the joint distribution, you just have to divide them to obtain random samples from $Z$. – joriki Apr 11 '12 at 9:18
No, I meant samples from the marginal distributions of $X$ and $Y$. Actually $X$ and $Y$ are identical and independent variables. – Lluis Apr 11 '12 at 9:54
up vote 3 down vote accepted

The question as clarified in a comment is trivial. Since $X$ and $Y$ are independent, samples from their marginal distributions can be combined to produce a sample from their joint distribution, and the quotient is a sample from $Z$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.