# 5 – M4 L1B 05 Covariance Matrix Using Factor Model V3

Okay. We talked about the assumptions inherent to factor models. Now, let’s derive the covariance matrix of the returns, in terms of the factor returns, exposures, and residual term. We need this description of the return variants, because we want to be able to use our factor model to describe and manage the portfolio variance, and use this information for optimization. We’ll need to use the two assumptions; one, that the residual of any asset is uncorrelated with the factor returns, and two, that the residual of any asset is uncorrelated with the residual of any other asset. Before we begin, we subtract from each asset random variable its mean. Such that the mean of this shifted return distribution is zero. We start with this equation, which is a factor model of the stock return. If there are many assets then r is a vector of observable random variables. What I mean by that is, r1 is a random variable that represents the return of asset one. It can take on any value with a probability determined by a probability distribution. R, is a vector of length equal to the number of assets. B, is a matrix of fixed that is not random coefficients, it has dimensions of assets by factors. F, is a vector of random variables, each of which represents the value of a factor return. Finally, this is the vector of residuals. Which as we said, are specific to the assets. So, there is a residual random variable for each asset. Now, we want to calculate the covariance matrix of the asset returns. Remember, that the covariance of two random variables can be calculated with this formula. But if the means of the two random variables are zero, this simplifies to the expectation value of their product. The expectation value of a matrix is just a matrix with the expectation value operator applied to each element. The matrix of products of asset returns, is just rr transpose. So, the covariance matrix can be written as the expectation value of rr transpose. This follows by our model for r. First, distribute the transpose to the two terms on the right. Here, we just expand out the matrix product. Now, distribute the transposes. We can pull the B matrix out of the expectation function, because it is not a random variable, it is fixed. Here, we use the fact that the residual errors and factor returns are assumed to be uncorrelated. The first assumption we discussed earlier. This means that the expected value of the factor returns times the errors is zero. So, the two terms in the middle becomes zero. We will now simplify our notation to represent the covariance matrix of the factor returns. Finally, we write down the covariance matrix of the residuals, which we know to be a diagonal matrix. Meaning that only the variances of the residuals may be nonzero, but the covariances between residuals of different assets are zero. The reason for this, is the second assumption from earlier; that the error random variables are assumed to be uncorrelated across assets. So, their covariances are zero.