1

I wish to generate three uniformly-distributions with specified correlations. How do I go about doing that?

For example, over here, a comment provides a quick method to generate pairs of random numbers which are uniformly distributed with specified correlation. I want to extend that to three uniform distributions.

I have read that copulas are the way to go about doing this, but I am unclear how. I have looked at this post and while it seems to be asking the same question that I am, I did not find the answers helpful. Any help is appreciated.

esperanto
  • 45
  • 4
  • Because the accepted answer in the duplicate works well and is fully explained and illustrated with working code, it is incumbent on you to indicate specifically in what ways it is not "helpful." That will enable us to formulate appropriate responses. – whuber May 23 '17 at 23:41
  • The first post you link should work for three variables (or more) just as well as for two simply by changing the correlation matrix in `gen.gauss.cop` to be bigger than 2x2 (N.B. how it relates to the last method at your second link - the main difference is the conversion between Spearman and Pearson correlations at the Gaussian before the random generation that's done at the first link, in order to get closer to the desired population correlation in the resulting uniforms). It's not clear how that first link doesn't answer to your question completely, so I have added it as a duplicate. – Glen_b May 23 '17 at 23:52
  • The last approach at your second link is more approximate (the transformation to uniform means the correlations will be slightly closer to 0 on average than specified) but the difference is quite small (the worst case is less than 0.019 different when the absolute value of the desired correlation is a little below 0.6). With any of the various methods at that second link you can figure out how to tweak the inputs to get (on average) the desired correlations coming out; one can simulate the relationship between how you generate and the correlations that come out for any particular copula. – Glen_b May 24 '17 at 00:16
  • If you needed to automate the conversion from a desired set of correlation to the parameters used in whichever approach from your second link (so that the population correlations were closer to correct on average) you could construct an approximate function for any of them at any given sample size. – Glen_b May 24 '17 at 00:31
  • 1
    I was looking for an analytical formulation. For example, the comment in one of the posts I have linked to suggests to consider $X$ to be a random variable uniformly distributed in [0,1]. And $Y = X$ if $X < \alpha$ and $Y = 1 + \alpha - X$ if $X \geq \alpha$. Then, $\rho = 2(\alpha - 1)^3 + 1$. Can we have a similar approach for three random variables? – esperanto May 24 '17 at 01:17
  • Yes, that can be done. I suspect you might not find it satisfactory, though: the approach can produce unusual joint distributions. You have a lot of flexibility to specify many more properties of the distribution you are looking for. Could you explain the ultimate purpose of this exercise? What statistical problem is it intended to solve? – whuber May 24 '17 at 13:37
  • The only property that I am looking for currently is analytical tractability. The ultimate purpose of this exercise is simply to model three inputs to an optimization problem, and look at how the optima varies when the correlation between the inputs is varied. At this stage, I am not too concerned even if the joint distributions is unusual. I am glad to hear that there is a lot of flexibility in how I go about doing this, so at a later stage, I may want to go back and tinker with that. Is there any general procedure and a reference that will be useful? Thanks for your help! – esperanto May 24 '17 at 17:15

0 Answers0