Generate data with a given covariance matrix and given non-normal distribution Question
I have a dataset of numbers, which I know to be correlated with a covariance matrix that I can reasonably estimate. This correlation has no (known) structure connected to time, space, clusters, or siimlar. Moreover, the values are not normally distributed.
For a sanity check (surrogate, resampling, or whatever you wish to call it), I want to generate artificial datasets with the following properties:


*

*The data is correlated as per the given covariance matrix.

*The values have the same distribution as the original data.


It probably suffices if those properties are only approximately preserved. You might call this a parametric bootstrap of correlated data.
What I found so far


*

*Resampling correlated data using bootstrap asks for the case of data with a known correlation structure. The books recommended in the answer only seem to address the case of correlations that originate from temporal or spacial sampling or from clusters.

*There are procedures for generating normally distributed data with a known correlation matrix, as addressed, e.g., in: Generating data with a given sample covariance matrix.

*My best ad-hoc approach so far would be: Generate normally distributed data adhering to the correlation matrix, and then rank-transform it to the target distribution, hoping that the correlation structure will not be affected too strongly.
 A: The question is very broad, with little specific information. The general answer is to use a copula. Since you specifically want to control the covariance matrix, a gaussian copula would be indicated, or more generally, an elliptical copula. The answer bt @DavidF is a link to a walk-through of such a solution. But if such a copula is a good fit to the data is another question entirely. 
After simulating data from the copula model, transform the margins one by one. If you want a better answer, tell us some more, like number of variables, and what is your ultimate goal?
A: I think what you need is explained here, and without the use of copulas: https://www.r-bloggers.com/easily-generate-correlated-variables-from-any-distribution-without-copulas/
In the words of the author of the linked article (Francis Smart), the proposed method is:

  
*
  
*Draw any number of variables from a joint normal distribution. 
  
*Apply the univariate normal CDF of variables to derive probabilities for each variable. 
  
*Finally, apply the inverse CDF of any distribution to simulate draws from that distribution.
The result is that the final variables are correlated in a similar
  manner to that of the original variables. This is because the rank
  order of the variables is maintained and thus correlations are
  approximately the same though not exact.

Hope it helps.
