Suppose C(u, v) is a copula. If (U, V) are U[0,1]-variables with copula C, then the conditional
distribution P(V ≤ v|U = u) can be computed as follows:
For 0 ≤ u, v ≤ 1,
$$P(V ≤ v|U = u) = \int_0^v f_{V|U}(y|u)dy = \int_0^v \frac{f_{U,V}(u,v)}{f_U(u)}dy$$
$$= \int_0^v \frac{\frac{\partial^2 C(u,y)}{\partial u \partial y}}{dy} = \frac{\partial C(u,v)}{\partial u}$$
Here we used the following facts: (i) For the U[0,1]-distribution (ii) the joint PDF of a distribution is
the mixed second partial derivative of its CDF, and (iii) the joint CDF of (U, V) is C(u, v). In the last
step, we applied the Fundamental Theorem of Calculus. Here is a recipe for generating from a
bivariate copula C(u, v).
1. Compute $c_u(v) := \frac{\partial C}{\partial u}$, and its inverse $c_u^{-1}$ (so that $c_u^{-1}(y) = v$ iff
$c_u(v) = y$).
2. Generate two independent U[0, 1]-RV U, W.
3. Let V := $c_u^{-1}(W)$, i.e. if the RV U has the numerical value u, let
V := $c_u^{-1}(W)$.
4. Then (U, V) have are U[0, 1]-variables with copula C.
The Clayton copula with parameter θ is defined by
$$C(u, v) = max\{ (u^{-\theta} + v^{-\theta} - 1)^{-\frac{1}{\theta}}, 0\}$$
1. Use the algorithm defined above to generate N = 2000 pairs (Un, Vn) of uniformly distributed
random numbers whose copula is the Clayton copula, with θ = 6. Plot the result using the
MATLAB function scatterhist.
2. Use the uniformly distributed (Un, Vn) obtained above in 1 to generate N = 1000 pairs of
standard normal variates (Xn, Yn) whose copula is the Clayton copula with θ = 10. Compute
the correlation ρ between X and Y, and generate N = 2000 pairs of standard normal variates
(X, Y) whose copula is the Gaussian copula with correlation ρ. Plot the pairs (Xn, Yn) and
(X, Y) using scatterhist and compare.