I am recently into copulas for finance, I've read several examples of how to generate dependent random variables with most kind of copulas. The problem for me is that all the books describe the case with 2 random variables $(X_1,X_2)$ but I want to generate $n$ dependent r.v. $(X_1,X_2,\ldots,X_n)$.

I find the case easy for gaussian copulas, since we just have to expand the correlation matrix, apply cholesky decomposition and calculate matrix multiplication.

But I couldn't find a way to apply this for the case of a clayton copula, since the book examples always use the conditional copula density of r.v. #1 to generate r.v. #2. This seems not like a practical approach for multi r.v.

Is there some approach like the one for the gaussian copula?

Best regards

  • 5
    $\begingroup$ The Clayton copula is an example of an Archimedean copula. Have a look at "Quantitative Risk Management" by Embrechts, Frey, McNeil Chapter 5.4.2 and 5.4.3. They define multivariate Archimedean copulas, provide simulation algorithms and give references to literature. $\endgroup$
    – g g
    Commented Jun 18, 2019 at 21:05

2 Answers 2


Since I think this is of interest for other people, I will post the approach I found:

First, let $C_n(u_1,\ldots,u_n)$ be a $n$ - dimensional Clayton copula with generator function $F$ and inverse $F^{-1}$. Then,

  1. Generate $n$ independent r.v. from $U (0,1)$

  2. Calculate $n-1$ derivatives of $F$, where $F_{n-1}$ denotes the $n-1$-th - order derivative of $F$

  3. Set $v_1 = u_1$

  4. Set $u_2 = C_2(v_2|v_1) = \frac{F_1(F^{-1}(v_1)+F^{-1}(v_2))}{F_1(F^{-1}(v_1)}$ and solve for $v_2$

  5. Repeat until $u_n = C_n(v_n|v_1,v_2,\ldots,v_{n-1)} = \frac{F_{n-1}(F^{-1}(v_1)+F^{-1}(v_2)+\ldots+F^{-1}(v_n))}{F_{n-1}(F^{-1}(v_1)+F^{-1}(v_2)+\ldots+F^{-1}(v_{n-1}))}$ and solve for $v_n$.

For the question regarding matlab code for simulating from gaussian copula, here some quick coding:

%% Simulations of bivariate Gaussian copulas 

%Example for rho=0.5
X = [x1; x2];

C = [1, rho; rho,1]; %2x2 Correlation matrix

cholesky = chol(C,'lower'); %lower triangular matrix of C using Cholesky decomposition

Copsims = cholesky*X;

c1 = Copsims(1,:);
c2 = Copsims(2,:);


corrcoef(c1,c2) %check for empirical rho, not on point the initial rho because of sampling error
  • $\begingroup$ Hope I don't miss something simple, but what is the idea behind the formula? My initial guess is the inverse of conditional CDF, but it doesn't look like it. $\endgroup$ Commented May 27, 2023 at 15:24

Clayton Copula-Matlab Code

    %% Simulations of Clayton copulas using conditional cdf

%Example for theta=4



Though for me, Gaussian seems uneasy, can you share a code, on how to do Gaussian Copula in Matlab?

  • $\begingroup$ added some code to the original answer $\endgroup$
    – simzoor
    Commented Sep 18, 2019 at 17:34

Your Answer

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

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