0
votes

I have a correlation matrix for N random variables. Each of them is uniformly distributed within [0,1]. I am trying to simulate these random variables, how can I do that? Note N > 2. I was trying to using Cholesky Decomposition and below is my steps:

  1. get the lower triangle of the correlation matrix (L=N*N)
  2. independently sample 10000 times for each of the N uniformly distributed random variables (S=N*10000)
  3. multiply the two: L*S, and this gives me correlated samples but the range of them is not within [0,1] anymore.

How can I solve the problem?

I know that if I only have 2 random variables I can do something like:

1*x1+sqrt(1-tho^2)*y1

to get my correlated sample y. But if you have more than two variables correlated, not sure what should I do.

1

1 Answers

0
votes

You can get approximate solutions by generating correlated normals using the Cholesky factorization, then converting them to U(0,1)'s using the normal CDF. The solution is approximate because the normals have the desired correlation, but converting to uniforms is a non-linear transformation and only linear xforms preserve correlation.

There's a transformation available which will give exact solutions if the transformed Var/Cov matrix is positive semidefinite, but that's not always the case. See the abstract at https://www.tandfonline.com/doi/abs/10.1080/03610919908813578.