 maneesh
Posts: 16
Joined: June 15th, 2006, 3:37 am

### How can I simulate correlated random numbers?

here is an interesting way to simulate correlated random numbers that I learnt recently from my boss. I thought I will share it. I had asked a question in interview about generating two correlated uniform random numbers and was expecting a standard answer. My boss told me a interestin way:1) I generate three uniform random numbers u1, u2 and u3.2) with probability p i pick up u1 and with prob (1-p) i pick u2 i.e i generate from mixture u43) now look at the corr between u3 and u4 ;-)I luved the soln.It can be generlised for a class of distribution. I will let you think abt it. leonpollard
Posts: 1
Joined: April 12th, 2006, 9:35 am

### How can I simulate correlated random numbers?

As mentioned the most correct method isGenerate vector of RV's ~N[0,1].Use the cholesky decompostion of the covariance matrix to transform this vector.For an XLL Excel Addin implementation of the two required functions goto:Function: randStd() at www.PimpMyExcel.com Function: CholeskyDC() at www.PimpMyExcel.com yoonus
Posts: 1
Joined: January 5th, 2009, 1:59 pm

### How can I simulate correlated random numbers?

If you want to generate two sets of correlated N(0,1) random number 1. Generated Z1, Z2 independent N(0,1)2. rho is correlation coefficient 3. Set e1 = z1 and e2 = rho*e1+sqrt(1-rho^2)*z24. e1 and e2 will have correlation of rho..if you want to generate more correlated random variableIF z ~ N(0,I) then AZ ~ N (0,AA^t)find the choelsky decomposition of E (variance - covariance matrix )that is E = L^t Lthen X ~ U + L^t ZThen X follows mutivariate correlated random variable Shtrauss
Posts: 23
Joined: October 26th, 2009, 3:06 am

### How can I simulate correlated random numbers?

is there a way to complement Choelsky decomposition for AZ? i.e. find these E and U in say matlab or R without using a pre-written algorithm? QuantOption
Posts: 269
Joined: February 8th, 2003, 9:00 pm

### How can I simulate correlated random numbers?

QuoteOriginally posted by: maneesh ... I had asked a question in interview about generating two correlated uniform random numbers and was expecting a standard answer.so what is the standard answer? thanks