# How to generate random variables which are correlated and yet marginally identically distributed? [closed]

I am wondering if there is a process to which we can generate random variables where there is a correlation structure between them, yet they are still marginally identically distributed? One idea that comes to mind is to work with perhaps random variables which are generated according to a stable law distribution. However, I am not sure how to modulate the correlation. Any ideas would be greatly appreciated.

• Where marginal distributions follow any distribution?
– Tim
Dec 5 '18 at 23:52
• Thanks, sorry for the confusion, I meant that the marginals would follow the same distribution. I'll change it above Dec 5 '18 at 23:55
• I was going to point you to an answer I wrote in regards to simulating from copula models. But then I realized you were the one who asked that question! Is the issue with using a Gaussian copula that it doesn't necessarily preserve the correlation matrix (i.e., pairwise correlations are not preserved due to non-linear transfromations)? Dec 6 '18 at 0:31
• Moreover, there's clearly an infinite number of ways to do this. The most obvious is to simply use a multivariate normal, but I assume that's not what you want. Providing us with more constraints can help us think of a solution that meets your actual needs. Dec 6 '18 at 0:37
• Maybe this is a lead
– Carl
Dec 6 '18 at 23:09

1. Some multivariate normal vectors, it is enough to require that the mean vector is constant $$\mu \mathbf{1}_n$$ and the covariance matrix is constant along the diagonal $$\text{diag}(\Sigma) = \sigma^2 \mathbf{1}_n$$. Then see Generating values from a multivariate Gaussian distribution. Similar ideas for any elliptically-contoured distribution.
3. Any exchangeable vector can be used. A very simple example is the following. Let $$X_1, X_2, \dotsc, X_n$$ be iid and $$Z$$ be independent of the $$X$$'s. Then $$X_1+Z, X_2+Z, \dotsc, X_n+Z$$ will satisfy your requirements. This is related to the representation theorem of de Finetti so quite general.
4. A copula is a joint distribution where all marginals are uniform on $$[0,1]$$. After simulating that, you can just transform the marginals with the usual quantile transform (probability integral transform).