Given two variable $x,y$, they are subjected to a joint probability density function:

$ f(x,y) = \dfrac{1}{3}(3x^2 + 4xy + 3y^2)\\ 0\leq x \leq 1;0\leq y \leq 1 $

Obviously, its corresponding cumulative distribution function (CDF) is:

$ F(x,y) = \dfrac{1}{3}(x^3y+x^2y^2+xy^3) $

My objective is to generate random samples from this CDF using the inverse tranformation method. As far as I know, the first step is to get the marginal CDF of $x$:

$ F_x = F(x,y=1) = \dfrac{1}{3}(x^3 + x^2 + x) $

Then we can readily get a random value of $x$, denoted as $u_x$.

Next, for sampling $y$, we have to derive its conditional CDF $F_{y|x}$ given $x$.

My question is how to derive the $F_{y|x}$? Can the well-known conditional rule still be adapted for this problem, such that:

$ F_{y|x} = \dfrac{F(x,y)}{F_x} $

It is worth noting that the actual CDF I encountered is much more complicated than the above example, and is very difficult to perform integration on the PDF or CDF.

Thank you very much!

  • $\begingroup$ "Copula" is a great search term. We have some threads about simulating from copulas. $\endgroup$
    – whuber
    Aug 6, 2021 at 15:33
  • 1
    $\begingroup$ @whuber: since the joint density is given, I am unsure copulas need be involved. $\endgroup$
    – Xi'an
    Aug 6, 2021 at 15:40
  • 1
    $\begingroup$ @Xi'an The approach taken in the question is that of sampling from a copula. $\endgroup$
    – whuber
    Aug 6, 2021 at 16:52
  • 1
    $\begingroup$ @whuber: Ah OK, sure! $\endgroup$
    – Xi'an
    Aug 6, 2021 at 18:27

1 Answer 1


If$$f(x,y) = \dfrac{1}{3}(3x^2 + 4xy + 3y^2)$$ then $$f_{Y|X=x}(y)\propto f(x,y)\propto 3x^2 + 4xy + 3y^2$$ leads to$$f_{Y|X=x}(y)=\dfrac{3x^2 + 4xy + 3y^2}{\underbrace{\int_0^1 (3x^2 + 4xy + 3y^2)\,\text dy}_{3x^2+2x+1}}$$ from which the conditional cdf can be derived.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.