Jan 08

Cholesky Decomposition

by David Harper, CFA, FRM, CIPM


FRM |

iStock_000001400737XSmall

It is not too hard to simultaneously simulate (to model) random variables. In Excel, for example, we can use use =NORMSINV(RAND()) to create standard random normal variables. The RAND() function is a uniform distribution bounded by {0,1}. The NORMSINV() translates the random number into the z-value that corresponds to the probability given by a cumulative distribution. For example, =NORMSINV(5%) returns -1.645 because 5% of the area under a normal curve lies to the left of - 1.645 standard deviations.

But no realistic asset or portfolio contains only one risk factor. To model several risk factors, we could simply generate multiple random variables. Put more technically, the realistic modeling scenario is a multivariate distribution function that models multiple random variables. But the problem with this approach, if we just stop there, is that correlations are not included. What we really want to do is simulate random variables but in such a way that we capture or reflect the correlations between the variables. In short, we want random but correlated variables.

The typical way to incorporate the correlation structure is by way of a Cholesky decomposition (or factorization). For FRM candidates, Jorion briefly touches on the Cholesky factorization in the 4th Edition FRM Handbook (pages 99 to 100); but, if you are not familiar with matrix math, this may not be a sufficient introduction.

In the EditGrid spreadsheet below, I performed a Cholesky decomposition for a simple three-asset case. This can be viewed separately or opened into a new sheet, if you would like to edit yourself. Please note: the decomposition below is not the endgame. It is a step along the way. It produces, for us to use, a matrix that can be used to produce returns that are random but correlated.

The sheet below has four small sections, each step is numbered in green.

  1. The covariance matrix. This contains the implied correlation structure; in fact, a covariance matrix can itself be decomposed into a correlation matrix and a volatility vector.
  2. The covariance matrix(R) will be decomposed into a lower-triangle matrix (L) and an upper-triangle matrix (U). Note they are mirrors of each other. Both have identical diagonals; their zero elements and nonzero elements are merely "flipped"
  3. Given that R = LU, we can solve for all of the matrix elements: a,b,c (the diagonal) and x, y, z. Note that is by definition. That's what a Cholesky decomposition is, it is the solution the produces two triangular matrices whose product is the original (covariance) matrix. (Note, if you play with the variables it is possible to produce an error: the matrix must be 'positive definite' and so not all matrices can be decomposed this way).
  4. Given the solution for the matrix elements, then I calculated the product of the triangle matrix to ensure the produce does equal the original covariance matrix (i.e., does LU = R?). Note, in Excel a single array formula can be used with = MMULT(); in EditGrid, it is just a set of MMULT() formulas.

The lower triangle (LU) is the result of the Cholesky Decomposition. It is the thing we can use to simulate random variables, that itself is "informed" by our covariance matrix.

EditGrid Spreadsheet by bt/admin.

Comments

  1. Be the first to leave a comment!

Leave a Comment