I know that if you fit your variables with parametric margins (e.g. beta, gamma) we can easily simulate from copula using the function Mvcd and rMvcd in R.but if you want to work with no parametric margins how can I simulate. I will be thankful for any information or code in R. Edit: as I know if you want to simulate with copulas you need to follow these steps:$\\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$ 1-Generate i.i.d. uniformly distributed random variables $U=\{u_i,i=1,...,N\}$ $~~~~~~~~~~~~~~~~~~~~~~\\$ 2-set $y_1=u_1$ $~~~~~~~~~~~~~~~~~~~\\$
3-set $u_2=C(y_2,|y_1)=C(y_2|u_1)=\frac{\partial C(y_2,u_1)}{\partial u_1}$ then $y_2=h^{-1}(u_2,y_1,\theta)$ in which the h function is defined as the conditional copula.
4-Continue until we obtain $y_N=h^{-1}(u_N,y_{N-1},\theta)$.
My question is when we do all these steps It should be noted that ${y1; y2; . . . ; yn}simulated from steps 1 to 4 are the time series in the frequency domain (i.e., marginals), and we will need to perform the one-to-one transformation to obtain the corresponding time series simulated in the real domain (e.g., through parametric distribution, empirical distribution, or kernel density based on the observed time series).
I fitted an empirical distribution to a set of time series data (Y) by following code in R: Ye=rank(Y)/(length(Y)+1)
So I need the inverse of this ecdf for transform the simulated data the original domain