# How to generate from the copula by inverse conditional cdf function of the copula?

I am trying to write a code (I am using MATLAB) for estimating the goodness of fit of the copula based on a Rosenblatt transformation ( Dobrić and Schmid 2007, http://dx.doi.org/10.1016/j.csda.2006.08.012) my question is this:

In the algorithm it says: "Generate i.i.d. observations from the copula with parameter theta (I can't use copularnd function because it only covers a few families). If my copula is bi-variate like C(u,v, theta) how can I generate these i.i.d. observations? what will be my input to copula function?

Thanks

• I have done some research and It seems that they generate u1 by random normal function (normrnd) and they plug u1 into inverse CDF function of copula to generate u2 but I have no idea how can I drive that function
– Fred
Nov 4, 2013 at 23:57
• Your link is not to a paper by Genest et al ... the linked paper is by Dobrić and Schmid. Please fix, either by changing the link to the one you meant or changing the name to correspond to the actual authors listed (and if you keep 'Genest' in your question, please correct the spelling of that name at the same time). Further, questions should as far as possible stand on their own (for example, what happens to your question if the paper is moved? Your question cannot be understood), so could you also explain what the transformation etc is in your question, & give a full reference to the paper? Nov 4, 2013 at 23:58
• it seems like you should modify your question to contain the information in your comment; you could edit that in while fixing the issues I mentioned in my previous comment. Nov 4, 2013 at 23:59
• @Glen_b Thanks I fixed the reference. I was not sure my comment is wright or wrong way to do it?! Also the reference is a DOI url and they are permanent
– Fred
Nov 5, 2013 at 0:02
• Thanks Fred. Please note that I edited my first comment with some additional issues; please take another look. I have upvoted because you're clearly trying to make your question better. Nov 5, 2013 at 0:03

## 1 Answer

A typical approach (see e.g. Nelsen 2006, p. 41) is to sample two independent uniform distributed random vectors $u$ and $y$ of the desired sample length. The conditional copula $C_u$ (conditioned on $u$) is given through the partial derivative: $$C_u(v) = \frac{\partial}{\partial u} C(u,v)$$ Hence, one needs to solve $C_u(v)=y$ for $v$ to get the desired pair $(u,v)$. For a "custom made" copula, one has to calculate its partial derivative and its quasi-inverse. In case the copula is not completely "custom made" it might already be covered in other statistical software. One might for instance take a look into the R packages copula and VineCopula offering a rich set of families (speaking from my R experience, there are more in R and of course in other languages).