1. Using matrix notation
We have just seen the drivers of portfolio mean and variance in the case of a portfolio with two assets. In this video, I show you how those results can be extended to the general case of N assets, where N can be any number of assets.
2. Variables at stake for n assets
When working with many assets, we just have to be careful about the many variables that come into play. I will show you how the use of matrices in R will help you in keeping the data analysis well organized.
The first matrix that we use is the matrix of portfolio weights. We have N assets and thus N portfolio weights: w1, w2, up to wN. We will stack them into a column-matrix of dimension N times 1 and call this the matrix w.
The next matrix we use is the matrix of asset returns.
For each of the assets, we have a return, that we denote as R1, R2 up to RN. Again these returns can be stacked into a column-matrix of dimension N times 1 that I call R.
For each asset, we also have an expected return. I will denote them as mu_i. So mu_1 is the expected return of asset 1, mu_2 is the expected return of asset 2, and so on. Stacking the N expected returns into the column matrix mu gives us the matrix of expected returns mu.
Last but not least, there is the covariance matrix.
For each of the assets, we have the variance of their return, which I denote by sigma square i.
For each pair of asset returns i and j, we have a covariance, which I denote by sigma_ij.
We have thus N variances, and for each pair of assets, we have a covariance.
In order to handle all those variances and covariances, it is useful to put them together into the so-called covariance matrix.
This is a square matrix with N rows and N columns.
The elements on the diagonal are the variances of each of the returns.
Outside of the diagonal are the covariances. For example, in row 2, column 1, we have the covariance between asset return 2 and asset return 1.
3. Generalizing from 2 to n assets
The aim of this video is to show you the drivers of the mean and variance of portfolio in the general case of N assets. The question to answer is thus how all these expected returns, variances, and covariances affect the portfolio mean and variance. I show you this in the table on the slide. It shows in the first column the results for the case of two assets,
4. Generalizing from 2 to n assets
and in the next column how it
5. Generalizing from 2 to n assets
generalizes to the case of N assets.
We see that in the general case, the portfolio return is the weighted average of the returns of all N assets.
It follows that the expected portfolio return is the weighted average of the expected returns of all N assets.
Finally, we have that the variance of the portfolio return is the sum of the squared weights times the variance of all N assets, plus, for each pair of assets, the product between their weights and their covariance.
6. Matrices simplify the notation
There is a large number of terms in each expression. These can be avoided by using matrix notation. Remember that we have four matrices: the weights w, the returns R, the expected returns mu, and the covariance matrix sigma.
I will also be using the transpose of the N times 1 column-matrix of weights. This is the 1 times N row-matrix of weights.
7. Simplifying the notation
We then have the following results: the portfolio return equals the transpose of the portfolio weights and the matrix of returns.
It follows that the expected portfolio return is the
8. Simplifying the notation
transpose of the weights times the matrix of expected returns.
Finally, one can show that the variance of the portfolio return
9. Simplifying the notation
equals the number you obtain by computing the product of the transpose of the weights times the covariance matrix times the weights again.
If this is new to you, these results may seem daunting, but you will see in the exercises that using the matrices simplifies a lot the data management when analyzing large portfolios in R.
10. Let's practice!
If this is new to you, these results may seem daunting, but you will see in the exercises that using the matrices simplifies the data management when analyzing large portfolios in R.