realtylerdurdon
New Member
- Joined
- Jan 20, 2004
- Messages
- 44
Hi board,
I want to calculate the yearly standard deviation of a portfolio with a few hundred stocks. I plan to first calculate the variance covariance matrix for the portfolio's stocks and then use matrix algebra (like here http://www.fenews.com/fen39/back_to_basics/Back to Basics Column-formulas.htm) to arrive at the porfolio's standard deviation.
I have a large array with stock returns that looks like this:
StockID;Year;Month;Return;Portfolio
123456;1990;1;0.05;1
234567;1990;1;0.06;1
345678;1990;1;0.02;2
...
If there would be 100 different stock IDs, I would like to calculate a 100x100 matrix that contains the covariances of the returns of the stocks of that portfolio for a specific year.
I did some experiments with array formulas like {=cov(if(stockID=...);if(stockID=...))} but that didn't work. I couldn't find any plugins that would help. Any ideas?
Thanks alot in advance!
I want to calculate the yearly standard deviation of a portfolio with a few hundred stocks. I plan to first calculate the variance covariance matrix for the portfolio's stocks and then use matrix algebra (like here http://www.fenews.com/fen39/back_to_basics/Back to Basics Column-formulas.htm) to arrive at the porfolio's standard deviation.
I have a large array with stock returns that looks like this:
StockID;Year;Month;Return;Portfolio
123456;1990;1;0.05;1
234567;1990;1;0.06;1
345678;1990;1;0.02;2
...
If there would be 100 different stock IDs, I would like to calculate a 100x100 matrix that contains the covariances of the returns of the stocks of that portfolio for a specific year.
I did some experiments with array formulas like {=cov(if(stockID=...);if(stockID=...))} but that didn't work. I couldn't find any plugins that would help. Any ideas?
Thanks alot in advance!