Serving the Quantitative Finance Community

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

How can I simulate correlated random numbers?

October 7th, 2008, 10:16 am

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.
 
User avatar
leonpollard
Posts: 1
Joined: April 12th, 2006, 9:35 am

How can I simulate correlated random numbers?

April 26th, 2009, 5:01 am

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
 
User avatar
yoonus
Posts: 1
Joined: January 5th, 2009, 1:59 pm

How can I simulate correlated random numbers?

May 14th, 2009, 3:35 am

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
 
User avatar
Shtrauss
Posts: 23
Joined: October 26th, 2009, 3:06 am

How can I simulate correlated random numbers?

November 12th, 2009, 9:30 pm

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?
 
User avatar
QuantOption
Posts: 269
Joined: February 8th, 2003, 9:00 pm

How can I simulate correlated random numbers?

February 12th, 2010, 4:14 pm

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