Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

I found a matlab example for modelling correlated asset paths: http://www.goddardconsulting.ca/matlab-monte-carlo-assetpaths-corr.html

In this model the author uses the matlab code chol() in order to calculate the cholesky decomposition on the correlation matrix. However, by default, chol(corr) returns the upper triangular matrix but in my understanding the lower triangular matrix is needed for generating correlated random numbers. This can be calculated by chol(corr,'lower'): http://www.mathworks.de/de/help/matlab/ref/chol.html

Now, is this simply a small error in the code example or did I misunderstand some theoretic basics?

Best

share|improve this question

1 Answer 1

up vote 1 down vote accepted

If you want to create one (column) vector X of correlated random variates, then you premultiply it with the lower triangular matrix L.

But when you create paths, every return observation is one vector of random numbers.

It is then a matter of how you arrange your data: if these observations are columns in an matrix X, you compute LX. But if you have the observations in the rows of a matrix, then you need transpose the product, and you postmultiply with L', which is an upper triangular matrix.

Perhaps the tutorial http://comisef.wikidot.com/tutorial:correlation helps.

share|improve this answer
    
since I have a TxN matrix with T observations and N time series I have to use the upper triangular, if I understood you correctly? –  Clems Aug 21 at 6:36
    
When the observations are in columns, multiply from the left with the lower triangular matrix. When the observations are in rows, multiply from the right with the upper triangular matrix. –  Enrico Schumann Aug 21 at 8:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.