Hello,
I got a question about a general method to find SD on a portfolio. We are in a financial market that trade stocks. The SD is 42% on all stocks on this market, and the covariance is 0.031. So the question is, what is the SD on a portfolio of 5, 10, 25 … up 10.000 of these stocks. So i am looking for the general function in which you just change the amount of stocks.
SD on a big portfolio can’t be done with simple calculator, you need a spreadsheet. What you need to do is a matrix of n x n where n is the quantity of stocks. First, calculate the returns of each stock and have a time series of returns for each stock. Second, build the matrix of variances and covariances and assign a weight for each stock. Using matrix theory (which I don’t remember 100% accurate right now) you have to use a formula to calculate the determinant (or something like that) of the matrix which is the variance finally. Then apply the square root to solve for the SD.
I do believe you need a practical guide to do this, look for something in youtube!
Thx.
But i think that you should be able to do it more simple than that (the question wants you to estimate the SD for a portfolio of 10.000 stocks), the simple reason i think that, is because the SD for each stock is the same as well as the covariance. So my guess is that there is a more simply way, than a matrix for 10.000 stocks
?
The formula for the SD of returns (risk) of a portfolio of just 2 stocks is the following:
SD (Rp2) = sqroot [wa^2*var(Ra) + wb^2*var(Rb) + 2*wa*wb*Sd(Ra)*Sd(Rb)*corr(Ra,Rb)]
The formula for a portfolio of 3 stocks is way larger:
SD (Rp3) = sqroot [wa^2*var(Ra) + wb^2*var(Rb) + wc^2*var(Rc) + 2*wa*wb*Sd(Ra)*Sd(Rb)*corr(Ra,Rb) + 2*wa*wc*Sd(Ra)*Sd(Rc)*corr(Ra,Rc) + 2*wb*wc*Sd(Rb)*Sd(Rc)*corr(Rb,Rc)]
Where:
w = weight of the stock in the whole portfolio
R = return vector of the stock
corr = simple correlation
var = variance
Sd = standard deviation
The formula for a portfolio of 10,000 stocks is … well, better get a spreadsheet and make that holy crap matrix, believe me.
The problem here is that we must take into consideration the correlation (or covariance) between each stock and the rest of stocks, so the formula exponentially increase to a matrix of 10,000 x 10,000 items to be calculated/considered.
Thank you,
But i found my general formula 
it is: sq.Root(Var(Rp) = 1/n * (Average Var. of the individual stocks) + (1 - 1/n) * (Avg. Cov. between stocks))
Nice formula, but it is an approximation. Where did you find this?
I dug out an old copy of Investments by Bodie, Kane, and Marcus. They use it to show the power of diversification as n increases.
I was obliged to make some research about this formula because never seen it before.
Assuming you got this formula from Bodie and Kane book as breadmaker said above, I think you got the formula wrong. First, if you see carefully, you are making like a “twice average” because 1/n attemps an average, and “(Average Var. of the individual stocks)” is already an average. The same for the other part of the sum.
I think you have seen the short version of the formula that, in fact, comes from the matrix n x n I told you in my previous posts. The author just summarizes it using a nomenclature commonly interpreted as “average” (a flat line above the variable), but they are not averages.
As far as I know until now is that if you want to calculate the risk of a portfolio of 10,000 stocks, you will need to use matrix math to reduce a matrix of 10,000 x 10,000 into a single number (SD of returns).
I exhort you to double check this formula.
I think the formula Uhrskov12 wrote is wrongly interpreted. I’m 100% agree with you it proves diversification as n increases, however that is not the correct calculation for SD of a whole portfolio.
I found the formula in Jonathan Berk and Peter DeMarzo’s textbook Corporate Finance, third edition page 360. (i took a picture of the page but i don’t know how to add it.) and just as breadmaker said, they use it to show the power of diversification.
But it is as i wrote it. I used the formula and got the right answers, so at least for my course it was right 
But as you said, the right way is to use a matrix, because you never got n stocks with identical SD and covariance in real life.