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.

calculating the volatility for a single stock is straightforward. However, I'm not sure whether my approach for calculating the volatility matrix for multiple stocks is correct:

I assume a log-normal distribution of the stock prices. Therefore I calculate the log returns, calculate the variance-covariance matrix of the log returns and perform the cholesky decomposition of the variance-covariance matrix. The result from the last step is, as far as I am aware of, the volatility matrix.

Let ln_sec be a m x n matrix with the log returns of n securities over a period of m months, then my matlab code is as follows:

vcm = cov(ln_sec) %var-cov matrix
vcm = vcm * 12 %annualize var-cov matrix
vm = chol(vcm) %volatility matrix

Would you agree on my approach?

Thank you.

Edit: I forgot to mention the application in order to discuss a suitable solution. The volatility matrix is used to calculate a market price of risk vector as follows

(drift - risk-free-rate*1)/vm

where drift is a n x 1 vector with the mean drift rates of n assets and 1 is a n x 1 vector with 1's. The market price of risk vector is then used to simulate a state-price density (pricing kernel).

share|improve this question

1 Answer 1

You can just take the diagonal of the var-cov matrix. This should give you the variance of each stock and then take sqrt of that for std. deviation.

sd = sqrt(diag(vcm))
share|improve this answer
thanks for your answer. I'm struggling with your solution because I would disregard the correlation between the assets... –  Clems Aug 9 at 9:27
Then it depends completely on the application of why are you doing this in the first place. I assumed you are looking at stocks individually. Can you elaborate what will you be using this for? Sometimes application derives what approach to use. –  Taran Aug 9 at 9:35
thanks for the hint. I edited my question above. –  Clems Aug 9 at 9:51

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.