# Simulating random variables given partial distributions and correlation

After Monte Carlo simulations I obtained approximated distributions for X and Y. Now I want to add some form of correlation between them.

To simulate random variables from a distribution the idea is to draw an uniform random variable x in [0,1] and use $c^{-1}(x)$ where c is the cumulative distribution function.

My first idea was to draw u and v correlated uniform random variable in [0,1] and use $c_x^{-1}(u)$ and $c_y^{-1}(v)$. But I don't know how it is possible to correlate uniform random variable, plus I dont think there is an easy way to link the correlation of u and v to a simple correlation between X and Y I want.

Is it possible to correlate my variable easily ? (meaning linearly, like with a specifyed coefficient $\rho$ of linear correlation)

After some online research, I found the concept of copulas but this seems to be a bit complex for what I want to do. I understand that copulas are used to specify the correlation structure. (I understand copulas are only for correlation structure so that you can have normal distributions with non normal copulas and non-normal distributions with normal copula for exemple. Is that true ?)

Using Copulas how is it possible to correlate my random variable ? If it is possible to use different copulas, how to choose one ?

How do that change for the same problem in dimension n ? For a given correlation matrix ? for copulas in general ?

• Copulas completely specify the joint distribution: that goes well beyond the mere correlation. They're really just that simple. For examples see stats.stackexchange.com/questions/124865, stats.stackexchange.com/questions/133881, and ats.stackexchange.com/questions/74588, inter alia. – whuber Jun 23 '15 at 23:31
• Thanks, that answer the simulation part about copulas. But what about the fitting part ? Is it possible to define a copula that will match both the unconditionnal distributions and a linear correlation ? In dimension n ? – lcrmorin Jun 24 '15 at 9:00
• In general, no, because there are restrictions on the possible correlation coefficients between two marginal distributions. But when the desired correlation coefficient does lie within those mathematically allowable bounds, it is always possible to find a copula that achieves that correlation coefficient. The same results apply in higher dimensions, but now the restrictions on the set of correlation coefficients become (much) more complicated. But this way of looking at things is backwards: math won't solve your statistical problem of characterizing the $(X,Y)$ dependence accurately. – whuber Jun 24 '15 at 13:09
• How would you proceed ? what are the constraint for C such that marginals and correlation match my criteria. I have definitions for C but no link to unconditional distribution or correlation. – lcrmorin Jun 24 '15 at 16:23
• The constraints depend on the distributions and are also due to the requirement that the covariance matrix be positive semi-definite. In your case I wouldn't proceed in this direction at all. Instead, I would consider how to use information from the data to characterize their multivariate distribution directly, rather than manufacturing some distribution (via a copula or otherwise) from just the correlation coefficients. I cannot be any more specific because you haven't told us about the data or your study objectives, both of which determine how to proceed. – whuber Jun 24 '15 at 17:06

• Practically, how do I use copulas given two sets of Monte carlo simulations for X and Y (ie: no explicit formula for distributions) and a $\rho$ factor ? Same question for the fitting of the conditional distribution. – lcrmorin Jun 24 '15 at 8:42