Serving the Quantitative Finance Community

 
User avatar
ileana
Topic Author
Posts: 0
Joined: July 5th, 2012, 10:18 am

cholesky decomposition

August 22nd, 2012, 10:56 am

I am trying to simulate 10 random correlated returns and I am using the Cholesky decomposition. (I have determined the Cholesky matrix both using eviews and excel->the result being identical). The correlation matrix for the simulated variables is not similar at all with the initial one. Does anyone know why this might happen? I know it's silly thing but I just can't figure it out
 
User avatar
daveangel
Posts: 5
Joined: October 20th, 2003, 4:05 pm

cholesky decomposition

August 22nd, 2012, 11:28 am

you aren't giving us much information ... which uniform rng are you using ? how you generating the normal deviates ? finally, and I would start with this if I were you, test it for two, three, four etc correlated normals and see if any work.
knowledge comes, wisdom lingers
 
User avatar
ileana
Topic Author
Posts: 0
Joined: July 5th, 2012, 10:18 am

cholesky decomposition

August 22nd, 2012, 2:17 pm

I am using the normal distribution for the simulations with 0 mean but different sigmas. Could this be the source of the problem? I simply generate them using =normsinv(rand(),0,sigma) in excel.
 
User avatar
daveangel
Posts: 5
Joined: October 20th, 2003, 4:05 pm

cholesky decomposition

August 22nd, 2012, 2:18 pm

rand() is notoriously poor ... but before dismissing it try the two and three asset cases
knowledge comes, wisdom lingers
 
User avatar
ileana
Topic Author
Posts: 0
Joined: July 5th, 2012, 10:18 am

cholesky decomposition

August 22nd, 2012, 2:20 pm

I did, the problem is the same. I also tried an add in. Do you have any suggestions for better MC sim?
 
User avatar
daveangel
Posts: 5
Joined: October 20th, 2003, 4:05 pm

cholesky decomposition

August 22nd, 2012, 3:12 pm

which addin did you use ? I have tried it with two assets using rand() and my implementation of Mersenne Twister. Seems rand() is more slightly worse than MT... but I recover a correlation that is not too far from my input. for example, if I use a correlation of 0.1 I get values of around 0.13
knowledge comes, wisdom lingers
 
User avatar
tags
Posts: 3602
Joined: February 21st, 2010, 12:58 pm

cholesky decomposition

August 22nd, 2012, 6:51 pm

the answer you are seeking for Excel is detailed here:Generating Correlated Normally Distributed Random Numbers in Excel(to the extent i understand what you are trying to achieve)you will find a nice how-to for Matlab, here:Generating Correlated Random Numbersand, a code snippet for similar results with R, here:Generation of correlated random numbers: blablabla
Last edited by tags on August 21st, 2012, 10:00 pm, edited 1 time in total.
 
User avatar
tags
Posts: 3602
Joined: February 21st, 2010, 12:58 pm

cholesky decomposition

August 22nd, 2012, 7:02 pm

and one can find help here:Cholesky Decompositionbut i now have much doubt this is what you are seeking ????
Last edited by tags on August 21st, 2012, 10:00 pm, edited 1 time in total.
 
User avatar
Blazes
Posts: 0
Joined: September 6th, 2004, 7:36 am

cholesky decomposition

August 23rd, 2012, 8:06 am

I am sure you have done this but do you recover the original covariance matrix when you multiply your upper and lower triangular decomposed matrices?What number of simulations are you using?Is here a scaling issue of some sort that is distorting your results? Not busy today so if you PM me your results I am happy to take a look.
 
User avatar
ileana
Topic Author
Posts: 0
Joined: July 5th, 2012, 10:18 am

cholesky decomposition

August 23rd, 2012, 9:24 am

I generate random correlated returns using the normsinv(rand(),0,sigma). I wanted to incorporate somehow in this that the distribution is not quite normal, so I calculate a special sigma that is equal to the stdev*(bootstrap alpha)/(normal alpha). The standard deviation is different for each asset so I simulate somehow correlated returns but "differently distributed". I am thinking this is probably the source of the distortion.Thanks a lot for your help. Also you can fin the addin I used here: http://www.esnips.com/displayimage.php? ... id=6025801
 
User avatar
Blazes
Posts: 0
Joined: September 6th, 2004, 7:36 am

cholesky decomposition

August 23rd, 2012, 10:11 am

OK. The simulated random variates you need to use are standard normal and independent. The volatility and correlation data is embedded in the decomposition you don't need to adjust the simulated variates for this. The other thing to watch for is getting the time scaling correct. Post an example on here if this doesn't help and I'll try to see where is the problem.
 
User avatar
ileana
Topic Author
Posts: 0
Joined: July 5th, 2012, 10:18 am

cholesky decomposition

August 23rd, 2012, 10:45 am

That was it! Thanks a lot