# Cholesky Decomposition on Correlation Matrix for Correlated Asset Paths

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

-

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.

-
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 '14 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 '14 at 8:54