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 ?

  • 2
    $\begingroup$ 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. $\endgroup$
    – whuber
    Commented Jun 23, 2015 at 23:31
  • $\begingroup$ 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 ? $\endgroup$ Commented Jun 24, 2015 at 9:00
  • 1
    $\begingroup$ 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. $\endgroup$
    – whuber
    Commented Jun 24, 2015 at 13:09
  • 1
    $\begingroup$ 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. $\endgroup$
    – whuber
    Commented Jun 24, 2015 at 17:06
  • 1
    $\begingroup$ Note that if you transform correlated uniforms, the transformed variables will have a different linear correlation (it may be only slightly different, or it may be very different). Indeed in some extreme cases the linear correlation can change sign even though the transformation is monotonic. However, rank correlations (like the Spearman and Kendall correlations) will be unaltered (which is one reason why they're often used when modelling with copulas). $\endgroup$
    – Glen_b
    Commented Sep 8, 2016 at 1:18

1 Answer 1


Copulas are a way of doing it.

Another way is to use an (unconditional) distribution for one of X and Y, .and a conditional distribution for the other of X and Y. So, for example, draw X from its unconditional distribution, and let's say the value you draw is u. Draw the corresponding value for Y from the distribution of Y conditional on X = u. I.e., draw X from P(X <= x) and corresponding Y from P(Y <= y | X = u). So you'll have to estimate (fit) such a conditional distribution for one of X or Y in order to be able to use this approach.

If X and Y jointly have a standard bivariate distribution, such as Bivariate Normal, you can use ready to go techniques which have already done what I described for you under the hood.. Further along those lines, the more information you provide, the more specific and focused an answer you can get.

  • $\begingroup$ 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. $\endgroup$ Commented Jun 24, 2015 at 8:42
  • $\begingroup$ Are X and Y being generated "together" within the same Monte Carlo simulation, and therefore with built-in auto-generated dependency? if so, then use paired samples of X and Y as directly came out of the simulation. Or even if run separately, are X and Y values from the Monte Carlo simulations "paired" per replication (Monte Carlo trials) such that they will have the proper dependency? If so, use paired values coming out of the simulations as your samples. If not, then what is the basis you have for saying what the correlation or dependency should be? $\endgroup$ Commented Jun 24, 2015 at 9:03
  • $\begingroup$ X and Y are generated by independent Monte-carlo simulations. Expert opinion. $\endgroup$ Commented Jun 24, 2015 at 9:25
  • $\begingroup$ Are you saying the correlation will be based on expert opinion? Who is the expert (you or someone else?) and what is the opinion? $\endgroup$ Commented Jun 24, 2015 at 9:41
  • 1
    $\begingroup$ I know NOTHING about your problem or simulations, so I am not the expert. You need the experts to provide more information. You can use all sorts of copulas, but who am I to say whether they make any sense for your problem, which I have no idea what it is. if you have chosen a Bivariate Normal distribution, you only need provide the individual variances and the correlation, and you're done. II am not saying you should be using a Bivariate Normal distribution, however. $\endgroup$ Commented Jun 24, 2015 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.