vendredi 28 juin 2019

Generate n-dim random samples based on empirical distribution and copula

I am given an empirical distribution $F^{\text{emp}}_{X}$ of a real-valued random variable $X$. Given now $X_1,\ldots,X_n$ having the same distribution as $X$ and dependencies given by a copula $C$. I would like now to produce random samples of $(X_1,\ldots,X_n)\in\mathbb{R}^n$ with R.

E.g. I am given a vector of samples and the corresponding cdf

x<-rnorm(1000)
df<-ecdf(x)

Assume that I pick for a example a t-student or Clayton copula $C$. How can I produce random samples of for example 10 copies of $x$, where their dependency is determined by $C$.

Is there an easy way? Or are their any packages that can be used here?




Aucun commentaire:

Enregistrer un commentaire