Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question
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 '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

Your Answer


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.