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:**

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

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

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:**

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