Solved – How to generate from the copula by inverse conditional cdf function of the copula

copularandom variable

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

Best 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).

Related Question