Suppose I want to model dependence between $d$ r.v.´s $Y_1,...,Y_d$ with the copula $C_\theta$, where $\theta$ are the corresponding parameters of that copula. I've also determined the correlation using Kendall's tau $\tau(Y_i,Y_j)=\gamma$ for all $i\neq j$. Now I want to generate samples from this joint distribution:
Am I on the right track when I say that, from Sklar's Theorem, we have that if $Y_k$'s corresponding distribution function is $G_k(y_k)$ and we have $X_1,...,X_d$ with distribution functions $F_1(x_1),...,F_d(x_d)$. Then $\bf{Y}$$=\left(G_1^{-1}(F_1(X_1)),...,G_d^{-1}(F_d(X_d))\right)$. So say for example that I want to generate samples of our t-distributed random vector $\bf{Y}$ from the join distribution using a Gaussian copula, I could just simply generate the normal random variables $Y_1,...,Y_d$ (independent) and then apply the t distribution function on the r.v. and then take the normal quantile function of that, using the $\Sigma$ where $$\Sigma_{i,j}=\begin{cases} 1, & \text{if $i=j$}.\\ sin(\frac{\pi}{2}\gamma), & \text{otherwise}. \end{cases}$$ as one of the parameters. Or should the dependence be taken into account for when I model the t-distributed vector $\bf{Y}$? I guess the first makes more sense since the copula is supposed to "model the dependence".
Say instead I want to do the same using the copula package in R. Is it correct to first create the copula object with $\Sigma$ (as before) using normalCopula and then mvdc and rmvdc to generate the samples? But what are the parameters for the mvdc function? The example code from R's web page gives the following:
mvdc(normalCopula(0.75), c("norm", "exp"),list(list(mean = 0, sd =2), list(rate = 2)))
But shouldn't the argument in the normalCopula function be a 2x2 matrix since its bivariate. Also, say now that I have $d$ equally t-distributed r.v.'s and I dont want to write c("t", .... ,"t") etc. How can I write this neatly?
As you can see I'm slightly confused about the parameters in the copula and in what step the correlation should be used (I'm also not sure when it is eligible to say that $\rho = sin(\frac{\pi}{2}\tau)$), so if someone could help clarifying that I'd be very thankful. Also, there are lots of examples of 2-dimensional (and some on 3-dimensional) examples of this on the internet since they are more illustrative than for higher dimensions. So if someone have references to examples of modelling with copulas in higher dimensions in R I would gladly accept that.
Edit:
Ok, say I want to model the joint distribution of two financial assets where the marginals are t-distributed with 3 degrees of freedom and standard deviation 0.05. Their correlation is estimated with $\tau(Y_1,Y_2)=0.5$ I've assumed their joint distribution should be normal, so I use a normal copula. To generate samples from their joint distribution. I first generate samples from the normal distribution:
X<-rmvnorm(N,mu,S) #mu is zero vector and #S is as $\Sigma$ before with $\gamma = 0.5$.
Now I transform each sample point $(X_k^1,X_k^2)$:
Y<-qt(pnorm(X),df=3)
Is this correct? But how do I control the variance/standard deviation of the marginals? Do I do that when I generate the multivariate normal or in the qt function?