Links to all tutorial articles (same as those on the Exam pages)Modeling portfolio variance in Excel
This article is about an Excel model for calculating portfolio variance. When it comes to calculating portfolio variance with just two assets, life is simple. But consider a situation when there are 10, 15, maybe hundreds of assets. This brief article is a practical demonstration of how portfolio variance can be modeled in Excel - the underlying math, and an actual spreadsheet for your playing pleasure! Enjoy! Calculating portfolio variance for a portfolio of two assets with a given correlation is a fairly trivial task – you use the formula
This formula is not really scalable to real life situations where a portfolio may consist of tens or hundreds of securities. What we really need for that is matrices, and Excel. This tutorial looks at how portfolio risk calculations can be modeled within Excel. You are unlikely to be asked to do this in the exam, in fact the multiple choice format is very poorly suited to testing such knowledge. Yet this is useful should you wish to see how this really would work in practice, or wish to test some additional ideas, for example, the impact of changing correlations on portfolio volatility.
The variance of a portfolio of correlated assets can be written as WTvW, where W is a column vector (ie a matrix with a single column) containing the weights of different assets in the portfolio. V is the covariance matrix, and WT is the transpose of the matrix W.
So for two assets, the combined variance of the portfolio can be written as follows in matrix notation:
Where w1 to wn are the weights of assets 1 to n in the portfolio, and σxy is the covariance between assets x and y. Note that σ12 means the variance of asset 1, which is nothing but the covariance of the asset with itself.
In practice we rarely have the covariance matrix. What we generally get is the correlation matrix, which gives us the correlation between any two of the assets in the portfolio in the form of a matrix.
If ρ be the correlation between two assets, then we know that ρ(x,y) = covariance(x,y)/σx σy. Therefore if we know the correlation matrix between assets, we can calculate the covariance matrix as follows:
where ρxy is the correlation between assets x and y, and σn is the standard deviation of the nth asset.
We can substitute this expression for the covariance matrix in #1 above to get the portfolio variance.
Therefore portfolio variance Matrices can be multiplied in Excel using the function MMULT, and because MMULT only takes two matrices as its arguments, we can nest a number of MMULTS within each other.
If possible, you should try constructing this spreadsheet yourself. It will clarify many concepts in a way that cannot be done from a mere reading of text.
|